#857 Create event for failed authentication

This commit is contained in:
ljacqu
2017-04-29 14:46:06 +02:00
parent dbb8ea7f38
commit d65556d893
5 changed files with 100 additions and 4 deletions
@@ -9,6 +9,7 @@ import fr.xephi.authme.data.auth.PlayerCache;
import fr.xephi.authme.data.limbo.LimboService;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.events.AuthMeAsyncPreLoginEvent;
import fr.xephi.authme.events.FailedLoginEvent;
import fr.xephi.authme.mail.EmailService;
import fr.xephi.authme.message.MessageKey;
import fr.xephi.authme.permission.AdminPermission;
@@ -180,6 +181,8 @@ public class AsynchronousLogin implements AsynchronousProcess {
*/
private void handleWrongPassword(Player player, String ip) {
ConsoleLogger.fine(player.getName() + " used the wrong password");
bukkitService.createAndCallEvent(isAsync -> new FailedLoginEvent(player, isAsync));
if (tempbanManager.shouldTempban(ip)) {
tempbanManager.tempbanPlayer(player);
} else if (service.getProperty(RestrictionSettings.KICK_ON_WRONG_PASSWORD)) {