summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-11-15 17:36:56 +0300
committerAndrei Karas <akaras@inbox.ru>2018-11-27 23:10:23 +0300
commit854626875ad7cd206de247f6da6607280a7fd58b (patch)
treecea295b61db7118647905dda7fd73eab0c9c50f2 /src/login
parent6bf44bf62f2c2a8bbe74b332dba6f583452cf10b (diff)
downloadhercules-854626875ad7cd206de247f6da6607280a7fd58b.tar.gz
hercules-854626875ad7cd206de247f6da6607280a7fd58b.tar.bz2
hercules-854626875ad7cd206de247f6da6607280a7fd58b.tar.xz
hercules-854626875ad7cd206de247f6da6607280a7fd58b.zip
Add incomplete packet CA_OTP_CODE.
Diffstat (limited to 'src/login')
-rw-r--r--src/login/lclif.c12
-rw-r--r--src/login/lclif.p.h14
2 files changed, 25 insertions, 1 deletions
diff --git a/src/login/lclif.c b/src/login/lclif.c
index b9ad7372f..f391c5bd7 100644
--- a/src/login/lclif.c
+++ b/src/login/lclif.c
@@ -233,6 +233,14 @@ static enum parsefunc_rcode lclif_parse_CA_ACK_MOBILE_OTP(int fd, struct login_s
return PACKET_VALID;
}
+/// @copydoc lclif_interface_private::parse_CA_OTP_CODE()
+static enum parsefunc_rcode lclif_parse_CA_OTP_CODE(int fd, struct login_session_data *sd) __attribute__((nonnull (2)));
+static enum parsefunc_rcode lclif_parse_CA_OTP_CODE(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)
@@ -526,6 +534,9 @@ static void packetdb_loaddb(void)
#if PACKETVER_MAIN_NUM >= 20181114 || PACKETVER_RE_NUM >= 20181114
packet_def(CA_ACK_MOBILE_OTP),
#endif
+#if PACKETVER_MAIN_NUM >= 20181114 || PACKETVER_RE_NUM >= 20181114 || defined(PACKETVER_ZERO)
+ packet_def(CA_OTP_CODE),
+#endif
packet_def(CA_REQ_HASH),
#undef packet_def
#undef packet_def2
@@ -591,6 +602,7 @@ void lclif_defaults(void)
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_OTP_CODE = lclif_parse_CA_OTP_CODE;
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 21fc2048a..815552eab 100644
--- a/src/login/lclif.p.h
+++ b/src/login/lclif.p.h
@@ -170,7 +170,7 @@ struct packet_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_id; ///< Packet ID (#PACKET_ID_CA_ACK_MOBILE_OTP)
int16 packet_len; ///< Length (variable length)
uint32 aid; ///< Account ID
char code[6]; ///< Code
@@ -182,6 +182,17 @@ DEFINE_PACKET_HEADER(CA_ACK_MOBILE_OTP, 0x09a3);
#define packet_CA_ACK_MOBILE_OTP PACKET_CA_ACK_MOBILE_OTP
#endif
+#if PACKETVER_MAIN_NUM >= 20181114 || PACKETVER_RE_NUM >= 20181114 || defined(PACKETVER_ZERO)
+struct PACKET_CA_OTP_CODE {
+ int16 packet_id; ///< Packet ID (#PACKET_ID_CA_OTP_CODE)
+ char code[9]; ///< Code
+} __attribute__((packed));
+DEFINE_PACKET_HEADER(CA_OTP_CODE, 0x0ad0);
+
+#define PACKET_ID_CA_OTP_CODE HEADER_CA_OTP_CODE
+#define packet_CA_OTP_CODE PACKET_CA_OTP_CODE
+#endif
+
/**
* Packet structure for CA_LOGIN_OTP.
*/
@@ -363,6 +374,7 @@ struct lclif_interface_private {
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_OTP_CODE; ///< Packet handler for #packet_CA_OTP_CODE.
LoginParseFunc *parse_CA_REQ_HASH; ///< Packet handler for #packet_CA_REQ_HASH.
LoginParseFunc *parse_CA_CHARSERVERCONNECT; ///< Packet handler for #packet_CA_CHARSERVERCONNECT.
};