From b1b56f2d515f76a2e528a7ba06b7e614812873b4 Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Wed, 29 Jun 2016 15:56:55 +0200 Subject: [PATCH] Cleanup, updated some settings --- .../protocollib/AuthMeInventoryPacketAdapter.java | 4 +--- .../fr/xephi/authme/process/join/AsynchronousJoin.java | 3 --- .../authme/process/quit/ProcessSyncronousPlayerQuit.java | 3 --- src/main/java/fr/xephi/authme/settings/Settings.java | 8 -------- src/test/java/fr/xephi/authme/task/PurgeServiceTest.java | 1 + 5 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/main/java/fr/xephi/authme/listener/protocollib/AuthMeInventoryPacketAdapter.java b/src/main/java/fr/xephi/authme/listener/protocollib/AuthMeInventoryPacketAdapter.java index 50c6cdfb6..88d83f611 100644 --- a/src/main/java/fr/xephi/authme/listener/protocollib/AuthMeInventoryPacketAdapter.java +++ b/src/main/java/fr/xephi/authme/listener/protocollib/AuthMeInventoryPacketAdapter.java @@ -24,7 +24,6 @@ import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.events.PacketEvent; import fr.xephi.authme.AuthMe; import fr.xephi.authme.cache.auth.PlayerCache; -import fr.xephi.authme.settings.Settings; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -52,8 +51,7 @@ public class AuthMeInventoryPacketAdapter extends PacketAdapter { PacketContainer packet = packetEvent.getPacket(); byte windowId = packet.getIntegers().read(0).byteValue(); - if (windowId == PLAYER_INVENTORY && Settings.protectInventoryBeforeLogInEnabled - && !PlayerCache.getInstance().isAuthenticated(player.getName())) { + if (windowId == PLAYER_INVENTORY && !PlayerCache.getInstance().isAuthenticated(player.getName())) { packetEvent.setCancelled(true); } } 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 f63973e39..7c83ec28b 100644 --- a/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java +++ b/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java @@ -65,9 +65,6 @@ public class AsynchronousJoin implements AsynchronousProcess { @Inject private BukkitService bukkitService; - @Inject - private ProtocolLibService protocolLibService; - @Inject private LimboPlayerTaskManager limboPlayerTaskManager; diff --git a/src/main/java/fr/xephi/authme/process/quit/ProcessSyncronousPlayerQuit.java b/src/main/java/fr/xephi/authme/process/quit/ProcessSyncronousPlayerQuit.java index 2ed9bb1f8..13a6a7b3b 100644 --- a/src/main/java/fr/xephi/authme/process/quit/ProcessSyncronousPlayerQuit.java +++ b/src/main/java/fr/xephi/authme/process/quit/ProcessSyncronousPlayerQuit.java @@ -19,9 +19,6 @@ public class ProcessSyncronousPlayerQuit implements SynchronousProcess { @Inject private JsonCache jsonCache; - @Inject - private DataSource database; - @Inject private ProcessService service; diff --git a/src/main/java/fr/xephi/authme/settings/Settings.java b/src/main/java/fr/xephi/authme/settings/Settings.java index 6e8430010..7c128d99a 100644 --- a/src/main/java/fr/xephi/authme/settings/Settings.java +++ b/src/main/java/fr/xephi/authme/settings/Settings.java @@ -18,10 +18,7 @@ public final class Settings { public static List getUnrestrictedName; public static boolean isPermissionCheckEnabled; public static boolean isTeleportToSpawnEnabled; - public static boolean isSessionsEnabled; public static boolean isAllowRestrictedIp; - public static boolean isSaveQuitLocationEnabled; - public static boolean protectInventoryBeforeLogInEnabled; public static boolean isStopEnabled; public static boolean reloadSupport; public static boolean noTeleport; @@ -31,7 +28,6 @@ public final class Settings { public static String getRegisteredGroup; public static String defaultWorld; public static String crazyloginFileName; - public static int getSessionTimeout; public static int getNonActivatedGroup; private static FileConfiguration configFile; @@ -48,17 +44,13 @@ public final class Settings { private static void loadVariables() { isPermissionCheckEnabled = load(PluginSettings.ENABLE_PERMISSION_CHECK); isTeleportToSpawnEnabled = load(RestrictionSettings.TELEPORT_UNAUTHED_TO_SPAWN); - isSessionsEnabled = load(PluginSettings.SESSIONS_ENABLED); - getSessionTimeout = configFile.getInt("settings.sessions.timeout", 10); isAllowRestrictedIp = load(RestrictionSettings.ENABLE_RESTRICTED_USERS); isRemoveSpeedEnabled = load(RestrictionSettings.REMOVE_SPEED); - isSaveQuitLocationEnabled = load(RestrictionSettings.SAVE_QUIT_LOCATION); getUnloggedinGroup = load(SecuritySettings.UNLOGGEDIN_GROUP); getNonActivatedGroup = configFile.getInt("ExternalBoardOptions.nonActivedUserGroup", -1); unRegisteredGroup = configFile.getString("GroupOptions.UnregisteredPlayerGroup", ""); getUnrestrictedName = load(RestrictionSettings.UNRESTRICTED_NAMES); getRegisteredGroup = configFile.getString("GroupOptions.RegisteredPlayerGroup", ""); - protectInventoryBeforeLogInEnabled = load(RestrictionSettings.PROTECT_INVENTORY_BEFORE_LOGIN); isStopEnabled = configFile.getBoolean("Security.SQLProblem.stopServer", true); reloadSupport = configFile.getBoolean("Security.ReloadCommand.useReloadCommandSupport", true); defaultWorld = configFile.getString("Purge.defaultWorld", "world"); diff --git a/src/test/java/fr/xephi/authme/task/PurgeServiceTest.java b/src/test/java/fr/xephi/authme/task/PurgeServiceTest.java index 3eb4bac4c..a631476ec 100644 --- a/src/test/java/fr/xephi/authme/task/PurgeServiceTest.java +++ b/src/test/java/fr/xephi/authme/task/PurgeServiceTest.java @@ -126,6 +126,7 @@ public class PurgeServiceTest { verifyScheduledPurgeTask(null, "alpha", "charlie"); } + @SuppressWarnings("unchecked") @Test public void shouldRecognizeNoPlayersToPurge() { // given