diff options
Diffstat (limited to 'src/login/login.c')
-rw-r--r-- | src/login/login.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/login/login.c b/src/login/login.c index 3db9558b8..a78276051 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -1360,6 +1360,41 @@ bool login_client_login(int fd, struct login_session_data *sd) return false; } +bool login_client_login_otp(int fd, struct login_session_data *sd) __attribute__((nonnull (2))); +bool login_client_login_otp(int fd, struct login_session_data *sd) +{ + // send ok response with fake token +#ifdef PACKETVER_ZERO +#if PACKETVER >= 20171127 + WFIFOHEAD(fd, 33); + WFIFOW(fd, 0) = 0x0ae3; + WFIFOW(fd, 2) = 33; // len + WFIFOL(fd, 4) = 0; // normal login + safestrncpy(WFIFOP(fd, 8), "S1000", 6); + safestrncpy(WFIFOP(fd, 28), "token", 6); + WFIFOSET(fd, 33); +#elif PACKETVER >= 20171123 + WFIFOHEAD(fd, 19); + WFIFOW(fd, 0) = 0x0ae3; + WFIFOW(fd, 2) = 19; // len + WFIFOL(fd, 4) = 0; // normal login + safestrncpy(WFIFOP(fd, 8), "S1000", 6); + safestrncpy(WFIFOP(fd, 14), "token", 6); + WFIFOSET(fd, 19); +#else + WFIFOHEAD(fd, 13); + WFIFOW(fd, 0) = 0x0ad1; + WFIFOW(fd, 2) = 13; // len + WFIFOL(fd, 4) = 0; // normal login + safestrncpy(WFIFOP(fd, 8), "token", 6); + WFIFOSET(fd, 13); +#endif + return true; +#else // PACKETVER_ZERO + return false; +#endif // PACKETVER_ZERO +} + void login_char_server_connection_status(int fd, struct login_session_data* sd, uint8 status) __attribute__((nonnull (2))); void login_char_server_connection_status(int fd, struct login_session_data* sd, uint8 status) { @@ -2218,6 +2253,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->parse_request_connection = login_parse_request_connection; login->auth_ok = login_auth_ok; login->auth_failed = login_auth_failed; |