summaryrefslogtreecommitdiff
path: root/src/net/eathena
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/eathena')
-rw-r--r--src/net/eathena/loginhandler.cpp18
-rw-r--r--src/net/eathena/loginhandler.h3
-rw-r--r--src/net/eathena/packetsout.inc13
3 files changed, 34 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