diff options
author | Andrei Karas <akaras@inbox.ru> | 2019-01-23 23:36:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2019-01-25 02:38:22 +0300 |
commit | 19366a7eae5cb6862da3212f8d3e16fe0bf9255e (patch) | |
tree | 6566eaac715be1d330ba67e46c2e0014dc334e07 | |
parent | 2f4a9f411ba4be70663b000228a4ee6227e080ac (diff) | |
download | plus-19366a7eae5cb6862da3212f8d3e16fe0bf9255e.tar.gz plus-19366a7eae5cb6862da3212f8d3e16fe0bf9255e.tar.bz2 plus-19366a7eae5cb6862da3212f8d3e16fe0bf9255e.tar.xz plus-19366a7eae5cb6862da3212f8d3e16fe0bf9255e.zip |
Add packet CMSG_LOGIN_MOBILE_OTP 0x09a3
-rw-r--r-- | src/net/eathena/loginhandler.cpp | 18 | ||||
-rw-r--r-- | src/net/eathena/loginhandler.h | 3 | ||||
-rw-r--r-- | src/net/eathena/packetsout.inc | 13 | ||||
-rw-r--r-- | src/net/loginhandler.h | 6 | ||||
-rw-r--r-- | src/net/tmwa/loginhandler.cpp | 5 | ||||
-rw-r--r-- | src/net/tmwa/loginhandler.h | 3 |
6 files changed, 48 insertions, 0 deletions
diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp index cabc9fad7..3293317c8 100644 --- a/src/net/eathena/loginhandler.cpp +++ b/src/net/eathena/loginhandler.cpp @@ -35,6 +35,10 @@ #include "debug.h" +extern int packetVersionMain; +extern int packetVersionRe; +extern int packets_zero; + namespace EAthena { @@ -164,4 +168,18 @@ void LoginHandler::updatePacketVersion() const updateProtocol(); } +void LoginHandler::sendMobileCode(const BeingId accountId, + const std::string &code) const +{ + if (packetVersionMain < 20181114 && + packetVersionRe < 20181114) + { + return; + } + createOutPacket(CMSG_LOGIN_MOBILE_OTP); + outMsg.writeInt16(14, "len"); + outMsg.writeBeingId(accountId, "account id"); + outMsg.writeStringNoLog(code, 6, "code"); +} + } // namespace EAthena diff --git a/src/net/eathena/loginhandler.h b/src/net/eathena/loginhandler.h index c50b5c465..87d5e16cf 100644 --- a/src/net/eathena/loginhandler.h +++ b/src/net/eathena/loginhandler.h @@ -58,6 +58,9 @@ class LoginHandler final : public Ea::LoginHandler void updatePacketVersion() const override final; + void sendMobileCode(const BeingId accountId, + 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 1b515706b..d9b269ba9 100644 --- a/src/net/eathena/packetsout.inc +++ b/src/net/eathena/packetsout.inc @@ -342,6 +342,7 @@ packet(CMSG_PLAYER_SET_TITLE, 0x0000, 0, nullptr); 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); #else // 20040713 if (packetVersion >= 20040713) @@ -1462,4 +1463,16 @@ if (packetVersionRe >= 20180718) packet(CMSG_PLAYER_SELECT_STYLE, 0x0afc, 16, clif->pReqStyleChange); } +// 20181114 main +if (packetVersionMain >= 20181114) +{ + packet(CMSG_LOGIN_MOBILE_OTP, 0x09a3, -1, lclif->p->parse_CA_ACK_MOBILE_OTP); +} + +// 20181114 re +if (packetVersionRe >= 20181114) +{ + packet(CMSG_LOGIN_MOBILE_OTP, 0x09a3, -1, lclif->p->parse_CA_ACK_MOBILE_OTP); +} + #endif diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h index d3c01dc70..3abc91443 100644 --- a/src/net/loginhandler.h +++ b/src/net/loginhandler.h @@ -24,6 +24,9 @@ #define NET_LOGINHANDLER_H #include "net/serverinfo.h" + +#include "enums/simpletypes/beingid.h" + #include "net/worldinfo.h" class LoginData; @@ -95,6 +98,9 @@ class LoginHandler notfinal virtual void updatePacketVersion() const = 0; + virtual void sendMobileCode(const BeingId accountId, + const std::string &code) const = 0; + virtual ~LoginHandler() { } diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp index 88ce7057b..e88069d25 100644 --- a/src/net/tmwa/loginhandler.cpp +++ b/src/net/tmwa/loginhandler.cpp @@ -141,4 +141,9 @@ void LoginHandler::updatePacketVersion() const itemIdLen = 2; } +void LoginHandler::sendMobileCode(const BeingId accountId A_UNUSED, + const std::string &code A_UNUSED) const +{ +} + } // namespace TmwAthena diff --git a/src/net/tmwa/loginhandler.h b/src/net/tmwa/loginhandler.h index ee04d82d3..7539569a0 100644 --- a/src/net/tmwa/loginhandler.h +++ b/src/net/tmwa/loginhandler.h @@ -60,6 +60,9 @@ class LoginHandler final : public Ea::LoginHandler static void requestUpdateHosts(); + void sendMobileCode(const BeingId accountId, + const std::string &code) const override final; + private: void sendLoginRegister(const std::string &restrict username, const std::string &restrict password, |