diff --git a/src/main/java/fr/xephi/authme/AuthMe.java b/src/main/java/fr/xephi/authme/AuthMe.java index a5220da6a..397533cf1 100644 --- a/src/main/java/fr/xephi/authme/AuthMe.java +++ b/src/main/java/fr/xephi/authme/AuthMe.java @@ -592,12 +592,6 @@ public class AuthMe extends JavaPlugin { return pluginHooks != null && pluginHooks.isNpc(player) || player.hasMetadata("NPC"); } - // Return the spawn location of a player - @Deprecated - public Location getSpawnLocation(Player player) { - return spawnLoader.getSpawnLocation(player); - } - private void scheduleRecallEmailTask() { if (!newSettings.getProperty(RECALL_PLAYERS)) { return; 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 ea27ddb3b..4d77a815b 100644 --- a/src/main/java/fr/xephi/authme/process/login/AsynchronousLogin.java +++ b/src/main/java/fr/xephi/authme/process/login/AsynchronousLogin.java @@ -73,20 +73,6 @@ public class AsynchronousLogin implements AsynchronousProcess { AsynchronousLogin() { } - - /** - * Queries the {@link fr.xephi.authme.cache.CaptchaManager} to - * see if a captcha needs to be entered in order to log in. - * - * @param player The player to check - * @return True if a captcha needs to be entered - */ - private boolean needsCaptcha(Player player) { - final String playerName = player.getName(); - - return captchaManager.isCaptchaRequired(playerName); - } - /** * Checks the precondition for authentication (like user known) and returns * the playerAuth-State @@ -141,7 +127,7 @@ public class AsynchronousLogin implements AsynchronousProcess { final String name = player.getName().toLowerCase(); // If Captcha is required send a message to the player and deny to login - if (needsCaptcha(player)) { + if (captchaManager.isCaptchaRequired(name)) { service.send(player, MessageKey.USAGE_CAPTCHA, captchaManager.getCaptchaCodeOrGenerateNew(name)); return; } @@ -218,7 +204,7 @@ public class AsynchronousLogin implements AsynchronousProcess { service.send(player, MessageKey.WRONG_PASSWORD); // If the authentication fails check if Captcha is required and send a message to the player - if (needsCaptcha(player)) { + if (captchaManager.isCaptchaRequired(name)) { service.send(player, MessageKey.USAGE_CAPTCHA, captchaManager.getCaptchaCodeOrGenerateNew(name)); } } 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 0ac3ff2c8..2d2f938c1 100644 --- a/src/main/java/fr/xephi/authme/process/login/ProcessSyncPlayerLogin.java +++ b/src/main/java/fr/xephi/authme/process/login/ProcessSyncPlayerLogin.java @@ -4,17 +4,14 @@ import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; import fr.xephi.authme.AuthMe; import fr.xephi.authme.cache.limbo.LimboCache; -import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.events.LoginEvent; import fr.xephi.authme.events.RestoreInventoryEvent; import fr.xephi.authme.listener.AuthMePlayerListener; -import fr.xephi.authme.listener.protocollib.ProtocolLibService; import fr.xephi.authme.process.ProcessService; import fr.xephi.authme.process.SynchronousProcess; import fr.xephi.authme.settings.properties.HooksSettings; import fr.xephi.authme.settings.properties.RegistrationSettings; import fr.xephi.authme.util.BukkitService; -import fr.xephi.authme.util.TeleportationService; import org.apache.commons.lang.reflect.MethodUtils; import org.bukkit.Bukkit; import org.bukkit.entity.LivingEntity; @@ -41,21 +38,12 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess { @Inject private LimboCache limboCache; - @Inject - private DataSource dataSource; - @Inject private BukkitService bukkitService; - @Inject - private ProtocolLibService protocolLibService; - @Inject private PluginManager pluginManager; - @Inject - private TeleportationService teleportationService; - ProcessSyncPlayerLogin() { } diff --git a/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java b/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java index 5d729c260..209ec480c 100644 --- a/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java +++ b/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java @@ -52,7 +52,6 @@ public class AsynchronousLogout implements AsynchronousProcess { limboCache.addPlayerData(player); playerCache.removePlayer(name); - // TODO LJ: No more teleport here? database.setUnlogged(name); syncProcessManager.processSyncPlayerLogout(player); } diff --git a/src/main/java/fr/xephi/authme/process/register/ProcessSyncPasswordRegister.java b/src/main/java/fr/xephi/authme/process/register/ProcessSyncPasswordRegister.java index c2409b236..ae40f6815 100644 --- a/src/main/java/fr/xephi/authme/process/register/ProcessSyncPasswordRegister.java +++ b/src/main/java/fr/xephi/authme/process/register/ProcessSyncPasswordRegister.java @@ -7,7 +7,6 @@ import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.cache.limbo.LimboCache; import fr.xephi.authme.events.LoginEvent; import fr.xephi.authme.events.RestoreInventoryEvent; -import fr.xephi.authme.listener.protocollib.ProtocolLibService; import fr.xephi.authme.output.MessageKey; import fr.xephi.authme.permission.AuthGroupType; import fr.xephi.authme.process.ProcessService; @@ -19,7 +18,6 @@ import fr.xephi.authme.settings.properties.RegistrationSettings; import fr.xephi.authme.settings.properties.SecuritySettings; import fr.xephi.authme.task.PlayerDataTaskManager; import fr.xephi.authme.util.BukkitService; -import fr.xephi.authme.util.TeleportationService; import fr.xephi.authme.util.Utils; import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -35,18 +33,18 @@ public class ProcessSyncPasswordRegister implements SynchronousProcess { @Inject private AuthMe plugin; + @Inject private ProcessService service; + @Inject private BukkitService bukkitService; - @Inject - private ProtocolLibService protocolLibService; + @Inject private LimboCache limboCache; + @Inject private PlayerDataTaskManager playerDataTaskManager; - @Inject - private TeleportationService teleportationService; ProcessSyncPasswordRegister() { } diff --git a/src/main/java/fr/xephi/authme/settings/Settings.java b/src/main/java/fr/xephi/authme/settings/Settings.java index 71b63e1a0..5682fae27 100644 --- a/src/main/java/fr/xephi/authme/settings/Settings.java +++ b/src/main/java/fr/xephi/authme/settings/Settings.java @@ -2,7 +2,6 @@ package fr.xephi.authme.settings; import fr.xephi.authme.AuthMe; import fr.xephi.authme.settings.domain.Property; -import fr.xephi.authme.settings.properties.PluginSettings; import fr.xephi.authme.settings.properties.RestrictionSettings; import fr.xephi.authme.settings.properties.SecuritySettings; import org.bukkit.configuration.file.FileConfiguration; @@ -16,16 +15,12 @@ import java.util.List; public final class Settings { public static List getUnrestrictedName; - public static boolean isPermissionCheckEnabled; - public static boolean isTeleportToSpawnEnabled; public static boolean isAllowRestrictedIp; public static boolean isStopEnabled; public static boolean reloadSupport; - public static boolean noTeleport; public static String getUnloggedinGroup; public static String unRegisteredGroup; public static String getRegisteredGroup; - public static String defaultWorld; public static int getNonActivatedGroup; private static FileConfiguration configFile; @@ -40,8 +35,6 @@ public final class Settings { } private static void loadVariables() { - isPermissionCheckEnabled = load(PluginSettings.ENABLE_PERMISSION_CHECK); - isTeleportToSpawnEnabled = load(RestrictionSettings.TELEPORT_UNAUTHED_TO_SPAWN); isAllowRestrictedIp = load(RestrictionSettings.ENABLE_RESTRICTED_USERS); getUnloggedinGroup = load(SecuritySettings.UNLOGGEDIN_GROUP); getNonActivatedGroup = configFile.getInt("ExternalBoardOptions.nonActivedUserGroup", -1); @@ -50,8 +43,6 @@ public final class Settings { getRegisteredGroup = configFile.getString("GroupOptions.RegisteredPlayerGroup", ""); isStopEnabled = configFile.getBoolean("Security.SQLProblem.stopServer", true); reloadSupport = configFile.getBoolean("Security.ReloadCommand.useReloadCommandSupport", true); - defaultWorld = configFile.getString("Purge.defaultWorld", "world"); - noTeleport = load(RestrictionSettings.NO_TELEPORT); } /** diff --git a/src/test/java/tools/dependencygraph/graph_stripped1time_20160612.dot b/src/test/java/tools/dependencygraph/graph_stripped1time_20160612.dot deleted file mode 100644 index afaaf9f22..000000000 --- a/src/test/java/tools/dependencygraph/graph_stripped1time_20160612.dot +++ /dev/null @@ -1,60 +0,0 @@ -digraph G { - - "PermissionsManager" -> "ValidationService"; - "NewSetting" -> "ValidationService"; - "DataSource" -> "ValidationService"; - "BukkitService" -> "AntiBot"; - "PermissionsManager" -> "AntiBot"; - "NewSetting" -> "AntiBot"; - "Messages" -> "AntiBot"; - "BukkitService" -> "TeleportationService"; - "PlayerCache" -> "TeleportationService"; - "NewSetting" -> "TeleportationService"; - "Messages" -> "TeleportationService"; - "SpawnLoader" -> "TeleportationService"; - "BukkitService" -> "SynchronousProcess"; - "PluginManager" -> "SynchronousProcess"; - "AuthMe" -> "SynchronousProcess"; - "TeleportationService" -> "SynchronousProcess"; - "LimboPlayerTaskManager" -> "SynchronousProcess"; - "ProcessService" -> "SynchronousProcess"; - "LimboCache" -> "SynchronousProcess"; - "DataSource" -> "SynchronousProcess"; - "BukkitService" -> "TempbanManager"; - "Messages" -> "TempbanManager"; - "NewSetting" -> "TempbanManager"; - "BukkitService" -> "LimboPlayerTaskManager"; - "PlayerCache" -> "LimboPlayerTaskManager"; - "Messages" -> "LimboPlayerTaskManager"; - "NewSetting" -> "LimboPlayerTaskManager"; - "LimboCache" -> "LimboPlayerTaskManager"; - "PluginManager" -> "PasswordSecurity"; - "AuthMeServiceInitializer" -> "PasswordSecurity"; - "NewSetting" -> "PasswordSecurity"; - "DataSource" -> "PasswordSecurity"; - "PluginManager" -> "PluginHooks"; - "Server" -> "PermissionsManager"; - "PluginManager" -> "PermissionsManager"; - "PermissionsManager" -> "LimboCache"; - "SpawnLoader" -> "LimboCache"; - "@DataFolder" -> "SpawnLoader"; - "NewSetting" -> "SpawnLoader"; - "PluginHooks" -> "SpawnLoader"; - "DataSource" -> "SpawnLoader"; - "BukkitService" -> "AsynchronousProcess"; - "CaptchaManager" -> "AsynchronousProcess"; - "SyncProcessManager" -> "AsynchronousProcess"; - "TempbanManager" -> "AsynchronousProcess"; - "PlayerCache" -> "AsynchronousProcess"; - "PasswordSecurity" -> "AsynchronousProcess"; - "LimboCache" -> "AsynchronousProcess"; - "DataSource" -> "AsynchronousProcess"; - "AuthMe" -> "AsynchronousProcess"; - "TeleportationService" -> "AsynchronousProcess"; - "LimboPlayerTaskManager" -> "AsynchronousProcess"; - "PermissionsManager" -> "AsynchronousProcess"; - "ValidationService" -> "AsynchronousProcess"; - "ProcessService" -> "AsynchronousProcess"; - "PluginHooks" -> "AsynchronousProcess"; - "AuthMe" -> "BukkitService"; -} \ No newline at end of file diff --git a/src/test/java/tools/dependencygraph/graph_stripped1time_20160612.png b/src/test/java/tools/dependencygraph/graph_stripped1time_20160612.png deleted file mode 100644 index 79d3b5040..000000000 Binary files a/src/test/java/tools/dependencygraph/graph_stripped1time_20160612.png and /dev/null differ