From 88e517635cf652b4b639e600f9ab06ccd336c07a Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Sun, 3 Apr 2016 13:03:16 +0200 Subject: [PATCH] wtf was that xD --- .../authme/listener/AuthMePlayerListener.java | 19 ++++++++++--------- .../authme/process/join/AsynchronousJoin.java | 1 - .../process/login/ProcessSyncPlayerLogin.java | 1 - .../fr/xephi/authme/settings/Settings.java | 2 -- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java b/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java index b5e0a9b3..3c545b1b 100644 --- a/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java +++ b/src/main/java/fr/xephi/authme/listener/AuthMePlayerListener.java @@ -3,6 +3,7 @@ package fr.xephi.authme.listener; import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; import fr.xephi.authme.AntiBot; +import fr.xephi.authme.AntiBot.AntiBotStatus; import fr.xephi.authme.AuthMe; import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.cache.auth.PlayerAuth; @@ -330,16 +331,16 @@ public class AuthMePlayerListener implements Listener { final String name = player.getName().toLowerCase(); boolean isAuthAvailable = dataSource.isAuthAvailable(name); + if (antiBot.getAntiBotStatus()==AntiBotStatus.ACTIVE && !isAuthAvailable) { + event.setKickMessage(m.retrieveSingle(MessageKey.KICK_ANTIBOT)); + event.setResult(PlayerLoginEvent.Result.KICK_OTHER); + return; + } + if (Settings.isKickNonRegisteredEnabled && !isAuthAvailable) { - if (Settings.antiBotInAction) { - event.setKickMessage(m.retrieveSingle(MessageKey.KICK_ANTIBOT)); - event.setResult(PlayerLoginEvent.Result.KICK_OTHER); - return; - } else { - event.setKickMessage(m.retrieveSingle(MessageKey.MUST_REGISTER_MESSAGE)); - event.setResult(PlayerLoginEvent.Result.KICK_OTHER); - return; - } + event.setKickMessage(m.retrieveSingle(MessageKey.MUST_REGISTER_MESSAGE)); + event.setResult(PlayerLoginEvent.Result.KICK_OTHER); + return; } if (name.length() > Settings.getMaxNickLength || name.length() < Settings.getMinNickLength) { diff --git a/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java b/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java index 900abd4c..e1820545 100644 --- a/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java +++ b/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java @@ -27,7 +27,6 @@ import fr.xephi.authme.util.Utils.GroupType; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.entity.Player; -import org.bukkit.inventory.PlayerInventory; import org.bukkit.entity.LivingEntity; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; diff --git a/src/main/java/fr/xephi/authme/process/login/ProcessSyncPlayerLogin.java b/src/main/java/fr/xephi/authme/process/login/ProcessSyncPlayerLogin.java index 48b4eda4..1a922ff8 100644 --- a/src/main/java/fr/xephi/authme/process/login/ProcessSyncPlayerLogin.java +++ b/src/main/java/fr/xephi/authme/process/login/ProcessSyncPlayerLogin.java @@ -4,7 +4,6 @@ import fr.xephi.authme.settings.NewSetting; import fr.xephi.authme.settings.properties.HooksSettings; import fr.xephi.authme.settings.properties.RegistrationSettings; import fr.xephi.authme.settings.properties.RestrictionSettings; -import fr.xephi.authme.settings.properties.PluginSettings; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.LivingEntity; diff --git a/src/main/java/fr/xephi/authme/settings/Settings.java b/src/main/java/fr/xephi/authme/settings/Settings.java index 4f449eb6..6d8e989f 100644 --- a/src/main/java/fr/xephi/authme/settings/Settings.java +++ b/src/main/java/fr/xephi/authme/settings/Settings.java @@ -25,8 +25,6 @@ public final class Settings { public static final File PLUGIN_FOLDER = Wrapper.getInstance().getDataFolder(); public static final File MODULE_FOLDER = new File(PLUGIN_FOLDER, "modules"); public static final File CACHE_FOLDER = new File(PLUGIN_FOLDER, "cache"); - // This is not an option! - public static boolean antiBotInAction = false; public static List allowCommands; public static List getJoinPermissions; public static List getUnrestrictedName;