From a212a0c0fd9aaeb078e492c3222e9e032cb61539 Mon Sep 17 00:00:00 2001 From: Xephi Date: Sun, 6 Dec 2015 11:08:33 +0100 Subject: [PATCH] Fix Captcha count --- .../fr/xephi/authme/process/login/AsynchronousLogin.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/fr/xephi/authme/process/login/AsynchronousLogin.java b/src/main/java/fr/xephi/authme/process/login/AsynchronousLogin.java index c52693252..025defb21 100644 --- a/src/main/java/fr/xephi/authme/process/login/AsynchronousLogin.java +++ b/src/main/java/fr/xephi/authme/process/login/AsynchronousLogin.java @@ -80,15 +80,12 @@ public class AsynchronousLogin { plugin.captcha.remove(name); plugin.captcha.putIfAbsent(name, i); } - if (plugin.captcha.containsKey(name) && plugin.captcha.get(name) >= Settings.maxLoginTry) { - plugin.cap.put(name, rdm.nextString()); + if (plugin.captcha.containsKey(name) && plugin.captcha.get(name) > Settings.maxLoginTry) { + plugin.cap.putIfAbsent(name, rdm.nextString()); for (String s : m.retrieve(MessageKey.USAGE_CAPTCHA)) { player.sendMessage(s.replace("THE_CAPTCHA", plugin.cap.get(name)).replace("", plugin.cap.get(name))); } return true; - } else if (plugin.captcha.containsKey(name) && plugin.captcha.get(name) >= Settings.maxLoginTry) { - plugin.captcha.remove(name); - plugin.cap.remove(name); } } return false;