Ver código fonte

Merge pull request #1507 from rathena/cleanup/char_bans

Adjusted the temporary ban check
Aleos 8 anos atrás
pai
commit
3f107dea76
2 arquivos alterados com 2 adições e 2 exclusões
  1. 1 1
      src/login/loginclif.c
  2. 1 1
      src/login/loginlog.c

+ 1 - 1
src/login/loginclif.c

@@ -197,7 +197,7 @@ static void logclif_auth_failed(struct login_session_data* sd, int result) {
 		    login_log(ip, sd->userid, result, msg_txt(22)); //unknow error
 	}
 
-	if( result == 1 && login_config.dynamic_pass_failure_ban )
+	if( (result == 0 || result == 1) && login_config.dynamic_pass_failure_ban )
 		ipban_log(ip); // log failed password attempt
 
 //#if PACKETVER >= 20120000 /* not sure when this started */

+ 1 - 1
src/login/loginlog.c

@@ -47,7 +47,7 @@ unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes) {
 	if( !enabled )
 		return 0;
 
-	if( SQL_ERROR == Sql_Query(sql_handle, "SELECT count(*) FROM `%s` WHERE `ip` = '%s' AND `rcode` = '1' AND `time` > NOW() - INTERVAL %d MINUTE",
+	if( SQL_ERROR == Sql_Query(sql_handle, "SELECT count(*) FROM `%s` WHERE `ip` = '%s' AND (`rcode` = '0' OR `rcode` = '1') AND `time` > NOW() - INTERVAL %d MINUTE",
 		log_login_db, ip2str(ip,NULL), minutes) )// how many times failed account? in one ip.
 		Sql_ShowDebug(sql_handle);