From 2b2b18938fe528f9999fb1674ed750c10f9c9880 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Wed, 10 Apr 2013 20:33:42 -0300 Subject: Implementing the new "login-failed" packet Signed-off-by: shennetsind --- src/login/login.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/login/login.c') diff --git a/src/login/login.c b/src/login/login.c index 712fa0e31..16835d675 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -1325,18 +1325,31 @@ void login_auth_failed(struct login_session_data* sd, int result) if( result == 1 && login_config.dynamic_pass_failure_ban ) ipban_log(ip); // log failed password attempt +#if PACKETVER >= 20120000 /* not sure when this started */ + WFIFOHEAD(fd,26); + WFIFOW(fd,0) = 0x83e; + WFIFOL(fd,2) = result; + if( result != 6 ) + memset(WFIFOP(fd,6), '\0', 20); + else { // 6 = Your are Prohibited to log in until %s + struct mmo_account acc; + time_t unban_time = ( accounts->load_str(accounts, &acc, sd->userid) ) ? acc.unban_time : 0; + timestamp2string((char*)WFIFOP(fd,6), 20, unban_time, login_config.date_format); + } + WFIFOSET(fd,26); +#else WFIFOHEAD(fd,23); WFIFOW(fd,0) = 0x6a; WFIFOB(fd,2) = (uint8)result; if( result != 6 ) memset(WFIFOP(fd,3), '\0', 20); - else - {// 6 = Your are Prohibited to log in until %s + else { // 6 = Your are Prohibited to log in until %s struct mmo_account acc; time_t unban_time = ( accounts->load_str(accounts, &acc, sd->userid) ) ? acc.unban_time : 0; timestamp2string((char*)WFIFOP(fd,3), 20, unban_time, login_config.date_format); } WFIFOSET(fd,23); +#endif } @@ -1493,7 +1506,7 @@ int parse_login(int fd) login_auth_failed(sd, 3); // send "rejected from server" return 0; } - + result = mmo_auth(sd, false); if( result == -1 ) -- cgit v1.2.3-60-g2f50