diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-11-15 09:03:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-11-27 23:10:23 +0300 |
commit | 602ea2bc985e317d483aedc89f80e052befec57a (patch) | |
tree | 299fd5295cc2da31f3e1b6f692cd4c3209133af8 /src/login/login.c | |
parent | fabfaf566459da17e1543be920769677d92c79b8 (diff) | |
download | hercules-602ea2bc985e317d483aedc89f80e052befec57a.tar.gz hercules-602ea2bc985e317d483aedc89f80e052befec57a.tar.bz2 hercules-602ea2bc985e317d483aedc89f80e052befec57a.tar.xz hercules-602ea2bc985e317d483aedc89f80e052befec57a.zip |
Add packet AC_REQ_MOBILE_OTP
Diffstat (limited to 'src/login/login.c')
-rw-r--r-- | src/login/login.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/login/login.c b/src/login/login.c index c1844cb25..dce85e9c7 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -35,6 +35,7 @@ #include "common/memmgr.h" #include "common/md5calc.h" #include "common/nullpo.h" +#include "common/packetsstatic_len.h" #include "common/random.h" #include "common/showmsg.h" #include "common/socket.h" @@ -67,6 +68,14 @@ static AccountDB *accounts = NULL; //----------------------------------------------------- #define AUTH_TIMEOUT 30000 +#if PACKETVER_MAIN_NUM >= 20181114 || PACKETVER_RE_NUM >= 20181114 || defined(PACKETVER_ZERO) +struct PACKET_AC_REQ_MOBILE_OTP { + int16 packet_id; ///< Packet ID (#PACKET_ID_CA_SSO_LOGIN_REQ) + uint32 aid; ///< Account ID +} __attribute__((packed)); +DEFINE_PACKET_HEADER(AC_REQ_MOBILE_OTP, 0x09a2); +#endif + /** * @see DBCreateData */ @@ -1400,6 +1409,18 @@ static bool login_client_login_otp(int fd, struct login_session_data *sd) #endif // PACKETVER_ZERO } +static void login_client_login_mobile_otp_request(int fd, struct login_session_data *sd) __attribute__((nonnull (2))); +static void login_client_login_mobile_otp_request(int fd, struct login_session_data *sd) +{ +#if PACKETVER_MAIN_NUM >= 20181114 || PACKETVER_RE_NUM >= 20181114 || defined(PACKETVER_ZERO) + WFIFOHEAD(sd->fd, sizeof(struct PACKET_AC_REQ_MOBILE_OTP)); + struct PACKET_AC_REQ_MOBILE_OTP *packet = WP2PTR(sd->fd); + packet->packet_id = HEADER_AC_REQ_MOBILE_OTP; + packet->aid = sd->account_id; + WFIFOSET(fd, sizeof(struct PACKET_AC_REQ_MOBILE_OTP)); +#endif +} + static void login_char_server_connection_status(int fd, struct login_session_data* sd, uint8 status) __attribute__((nonnull (2))); static void login_char_server_connection_status(int fd, struct login_session_data* sd, uint8 status) { @@ -2275,6 +2296,7 @@ void login_defaults(void) login->parse_fromchar = login_parse_fromchar; login->client_login = login_client_login; login->client_login_otp = login_client_login_otp; + login->client_login_mobile_otp_request = login_client_login_mobile_otp_request; login->parse_request_connection = login_parse_request_connection; login->auth_ok = login_auth_ok; login->auth_failed = login_auth_failed; |