diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-11-15 07:33:05 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-11-27 23:10:23 +0300 |
commit | fabfaf566459da17e1543be920769677d92c79b8 (patch) | |
tree | c18f225ad7223a057e64be576b83b987984f5fb7 /src/login | |
parent | 41d370cd3308be48b4ce00a50ee46515742978b0 (diff) | |
download | hercules-fabfaf566459da17e1543be920769677d92c79b8.tar.gz hercules-fabfaf566459da17e1543be920769677d92c79b8.tar.bz2 hercules-fabfaf566459da17e1543be920769677d92c79b8.tar.xz hercules-fabfaf566459da17e1543be920769677d92c79b8.zip |
Add incomplete packet CA_ACK_MOBILE_OTP.
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/lclif.c | 12 | ||||
-rw-r--r-- | src/login/lclif.p.h | 22 |
2 files changed, 34 insertions, 0 deletions
diff --git a/src/login/lclif.c b/src/login/lclif.c index 1cb8bfdbd..b9ad7372f 100644 --- a/src/login/lclif.c +++ b/src/login/lclif.c @@ -225,6 +225,14 @@ static enum parsefunc_rcode lclif_parse_CA_LOGIN_OTP(int fd, struct login_sessio return PACKET_VALID; } +/// @copydoc lclif_interface_private::parse_CA_ACK_MOBILE_OTP() +static enum parsefunc_rcode lclif_parse_CA_ACK_MOBILE_OTP(int fd, struct login_session_data *sd) __attribute__((nonnull (2))); +static enum parsefunc_rcode lclif_parse_CA_ACK_MOBILE_OTP(int fd, struct login_session_data *sd) +{ + // TODO: parsing packet data + return PACKET_VALID; +} + /// @copydoc lclif_interface_private::parse_CA_REQ_HASH() static enum parsefunc_rcode lclif_parse_CA_REQ_HASH(int fd, struct login_session_data *sd) __attribute__((nonnull (2))); static enum parsefunc_rcode lclif_parse_CA_REQ_HASH(int fd, struct login_session_data *sd) @@ -515,6 +523,9 @@ static void packetdb_loaddb(void) packet_def(CA_LOGIN_HAN), packet_def2(CA_SSO_LOGIN_REQ, -1), packet_def(CA_LOGIN_OTP), +#if PACKETVER_MAIN_NUM >= 20181114 || PACKETVER_RE_NUM >= 20181114 + packet_def(CA_ACK_MOBILE_OTP), +#endif packet_def(CA_REQ_HASH), #undef packet_def #undef packet_def2 @@ -579,6 +590,7 @@ void lclif_defaults(void) lclif->p->parse_CA_LOGIN_HAN = lclif_parse_CA_LOGIN_HAN; lclif->p->parse_CA_SSO_LOGIN_REQ = lclif_parse_CA_SSO_LOGIN_REQ; lclif->p->parse_CA_LOGIN_OTP = lclif_parse_CA_LOGIN_OTP; + lclif->p->parse_CA_ACK_MOBILE_OTP = lclif_parse_CA_ACK_MOBILE_OTP; lclif->p->parse_CA_REQ_HASH = lclif_parse_CA_REQ_HASH; lclif->p->parse_CA_CHARSERVERCONNECT = lclif_parse_CA_CHARSERVERCONNECT; } diff --git a/src/login/lclif.p.h b/src/login/lclif.p.h index a80caafa2..e4d6fe31f 100644 --- a/src/login/lclif.p.h +++ b/src/login/lclif.p.h @@ -28,6 +28,7 @@ #include "common/hercules.h" #include "common/mmo.h" +#include "common/packetsstatic_len.h" /* Definitions and macros */ /// Maximum amount of packets processed at once from the same client @@ -60,6 +61,7 @@ enum login_packet_id { PACKET_ID_AC_ACCEPT_LOGIN = 0x0069, PACKET_ID_AC_ACCEPT_LOGIN2 = 0x0ac4, + PACKET_ID_AC_REQ_MOBILE_OTP = 0x09a2, PACKET_ID_AC_REFUSE_LOGIN = 0x006a, PACKET_ID_SC_NOTIFY_BAN = 0x0081, PACKET_ID_AC_ACK_HASH = 0x01dc, @@ -162,6 +164,25 @@ struct packet_CA_SSO_LOGIN_REQ { char t1[]; ///< SSO Login Token (variable length) } __attribute__((packed)); +#if PACKETVER_MAIN_NUM >= 20181114 || PACKETVER_RE_NUM >= 20181114 +/** + * Packet structure for CA_SSO_LOGIN_REQ. + * + * Variable-length packet. + */ +struct PACKET_CA_ACK_MOBILE_OTP { + int16 packet_id; ///< Packet ID (#PACKET_ID_CA_SSO_LOGIN_REQ) + int16 packet_len; ///< Length (variable length) + uint32 aid; ///< Account ID + char code[6]; ///< Code +} __attribute__((packed)); + +DEFINE_PACKET_HEADER(CA_ACK_MOBILE_OTP, 0x09a3); +// for enum login_packet_id +#define PACKET_ID_CA_ACK_MOBILE_OTP HEADER_CA_ACK_MOBILE_OTP +#define packet_CA_ACK_MOBILE_OTP PACKET_CA_ACK_MOBILE_OTP +#endif + /** * Packet structure for CA_LOGIN_OTP. */ @@ -342,6 +363,7 @@ struct lclif_interface_private { LoginParseFunc *parse_CA_LOGIN_HAN; ///< Packet handler for #packet_CA_LOGIN_HAN. LoginParseFunc *parse_CA_SSO_LOGIN_REQ; ///< Packet handler for #packet_CA_SSO_LOGIN_REQ. LoginParseFunc *parse_CA_LOGIN_OTP; ///< Packet handler for #packet_CA_LOGIN_OTP. + LoginParseFunc *parse_CA_ACK_MOBILE_OTP; ///< Packet handler for #packet_CA_ACK_MOBILE_OTP. LoginParseFunc *parse_CA_REQ_HASH; ///< Packet handler for #packet_CA_REQ_HASH. LoginParseFunc *parse_CA_CHARSERVERCONNECT; ///< Packet handler for #packet_CA_CHARSERVERCONNECT. }; |