+ * Set the normal group of a player. + * + * @param player The player. + * @param group The normal group. + * + * @return True on success, false on failure. + */ + public boolean addNormal(Player player, String group) { + // Check whether the permissions check is enabled + if (!settings.getProperty(PluginSettings.ENABLE_PERMISSION_CHECK)) { + return false; + } + + // Remove old groups + permissionsManager.removeGroups(player, Arrays.asList(Settings.unRegisteredGroup, + Settings.getRegisteredGroup, Settings.getUnloggedinGroup)); + + // Add the normal group, return the result + return permissionsManager.addGroup(player, group); + } + } diff --git a/src/main/java/fr/xephi/authme/process/SyncProcessManager.java b/src/main/java/fr/xephi/authme/process/SyncProcessManager.java index 221e1e8c..894c3a48 100644 --- a/src/main/java/fr/xephi/authme/process/SyncProcessManager.java +++ b/src/main/java/fr/xephi/authme/process/SyncProcessManager.java @@ -71,11 +71,11 @@ public class SyncProcessManager { }); } - public void processSyncPlayerQuit(final Player player, final boolean isOp, final boolean needToChange) { + public void processSyncPlayerQuit(final Player player) { runTask(new Runnable() { @Override public void run() { - processSyncronousPlayerQuit.processSyncQuit(player, isOp, needToChange); + processSyncronousPlayerQuit.processSyncQuit(player); } }); } 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 b242f1c3..4ed00680 100644 --- a/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java +++ b/src/main/java/fr/xephi/authme/process/join/AsynchronousJoin.java @@ -9,7 +9,6 @@ import fr.xephi.authme.cache.limbo.LimboCache; import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.events.ProtectInventoryEvent; import fr.xephi.authme.hooks.PluginHooks; -import fr.xephi.authme.listener.protocollib.ProtocolLibService; import fr.xephi.authme.output.MessageKey; import fr.xephi.authme.permission.AuthGroupType; import fr.xephi.authme.permission.PlayerStatePermission; @@ -20,9 +19,8 @@ import fr.xephi.authme.settings.properties.PluginSettings; import fr.xephi.authme.settings.properties.RegistrationSettings; import fr.xephi.authme.settings.properties.RestrictionSettings; import fr.xephi.authme.settings.properties.SecuritySettings; -import fr.xephi.authme.task.LimboPlayerTaskManager; +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.apache.commons.lang.reflect.MethodUtils; import org.bukkit.GameMode; @@ -63,19 +61,14 @@ public class AsynchronousJoin implements AsynchronousProcess { @Inject private PluginHooks pluginHooks; - @Inject - private TeleportationService teleportationService; - @Inject private BukkitService bukkitService; @Inject - private ProtocolLibService protocolLibService; + private PlayerDataTaskManager playerDataTaskManager; - @Inject - private LimboPlayerTaskManager limboPlayerTaskManager; - - AsynchronousJoin() { } + AsynchronousJoin() { + } public void processJoin(final Player player) { @@ -122,19 +115,19 @@ public class AsynchronousJoin implements AsynchronousProcess { return; } + final boolean isAuthAvailable = database.isAuthAvailable(name); if (isAuthAvailable) { + limboCache.addPlayerData(player); service.setGroup(player, AuthGroupType.NOT_LOGGED_IN); - teleportationService.teleportOnJoin(player); - limboCache.updateLimboPlayer(player); // Protect inventory if (service.getProperty(PROTECT_INVENTORY_BEFORE_LOGIN)) { ProtectInventoryEvent ev = new ProtectInventoryEvent(player); bukkitService.callEvent(ev); if (ev.isCancelled()) { - protocolLibService.sendInventoryPacket(player); + player.updateInventory(); if (!service.getProperty(SecuritySettings.REMOVE_SPAM_FROM_CONSOLE)) { ConsoleLogger.info("ProtectInventoryEvent has been cancelled for " + player.getName() + "..."); } @@ -157,7 +150,9 @@ public class AsynchronousJoin implements AsynchronousProcess { } } } else { - // Not Registered + // Not Registered. Delete old data, load default one. + limboCache.deletePlayerData(player); + limboCache.addPlayerData(player); // Groups logic service.setGroup(player, AuthGroupType.UNREGISTERED); @@ -166,13 +161,6 @@ public class AsynchronousJoin implements AsynchronousProcess { if (!service.getProperty(RegistrationSettings.FORCE)) { return; } - - teleportationService.teleportOnJoin(player); - } - // The user is not logged in - - if (!limboCache.hasLimboPlayer(name)) { - limboCache.addLimboPlayer(player); } final int registrationTimeout = service.getProperty(RestrictionSettings.TIMEOUT) * TICKS_PER_SECOND; @@ -200,8 +188,8 @@ public class AsynchronousJoin implements AsynchronousProcess { }); // Timeout and message task - limboPlayerTaskManager.registerTimeoutTask(player); - limboPlayerTaskManager.registerMessageTask(name, isAuthAvailable); + playerDataTaskManager.registerTimeoutTask(player); + playerDataTaskManager.registerMessageTask(name, isAuthAvailable); } private boolean isPlayerUnrestricted(String name) { @@ -211,11 +199,12 @@ public class AsynchronousJoin implements AsynchronousProcess { /** * Returns whether the name is restricted based on the restriction settings. * - * @param name The name to check - * @param ip The IP address of the player + * @param name The name to check + * @param ip The IP address of the player * @param domain The hostname of the IP address + * * @return True if the name is restricted (IP/domain is not allowed for the given name), - * false if the restrictions are met or if the name has no restrictions to it + * false if the restrictions are met or if the name has no restrictions to it */ private boolean isNameRestricted(String name, String ip, String domain) { if (!service.getProperty(RestrictionSettings.ENABLE_RESTRICTED_USERS)) { @@ -242,7 +231,8 @@ public class AsynchronousJoin implements AsynchronousProcess { * settings and permissions). If this is the case, the player is kicked. * * @param player the player to verify - * @param ip the ip address of the player + * @param ip the ip address of the player + * * @return true if the verification is OK (no infraction), false if player has been kicked */ private boolean validatePlayerCountForIp(final Player player, String ip) { 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 18e7e8e4..4d77a815 100644 --- a/src/main/java/fr/xephi/authme/process/login/AsynchronousLogin.java +++ b/src/main/java/fr/xephi/authme/process/login/AsynchronousLogin.java @@ -6,7 +6,7 @@ import fr.xephi.authme.cache.TempbanManager; import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerCache; import fr.xephi.authme.cache.limbo.LimboCache; -import fr.xephi.authme.cache.limbo.LimboPlayer; +import fr.xephi.authme.cache.limbo.PlayerData; import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.events.AuthMeAsyncPreLoginEvent; import fr.xephi.authme.output.MessageKey; @@ -23,11 +23,10 @@ import fr.xephi.authme.settings.properties.DatabaseSettings; import fr.xephi.authme.settings.properties.EmailSettings; import fr.xephi.authme.settings.properties.RestrictionSettings; import fr.xephi.authme.settings.properties.SecuritySettings; -import fr.xephi.authme.task.LimboPlayerTaskManager; +import fr.xephi.authme.task.PlayerDataTaskManager; import fr.xephi.authme.util.BukkitService; import fr.xephi.authme.util.StringUtils; import fr.xephi.authme.util.Utils; -import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.entity.Player; @@ -70,24 +69,10 @@ public class AsynchronousLogin implements AsynchronousProcess { private TempbanManager tempbanManager; @Inject - private LimboPlayerTaskManager limboPlayerTaskManager; + private PlayerDataTaskManager playerDataTaskManager; 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 @@ -106,7 +91,7 @@ public class AsynchronousLogin implements AsynchronousProcess { service.send(player, MessageKey.USER_NOT_REGISTERED); // TODO ljacqu 20160612: Why is the message task being canceled and added again here? - limboPlayerTaskManager.registerMessageTask(name, false); + playerDataTaskManager.registerMessageTask(name, false); return null; } @@ -126,7 +111,7 @@ public class AsynchronousLogin implements AsynchronousProcess { } AuthMeAsyncPreLoginEvent event = new AuthMeAsyncPreLoginEvent(player); - Bukkit.getServer().getPluginManager().callEvent(event); + bukkitService.callEvent(event); if (!event.canLogin()) { return null; } @@ -142,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; } @@ -197,14 +182,9 @@ public class AsynchronousLogin implements AsynchronousProcess { // task, we schedule it in the end // so that we can be sure, and have not to care if it might be // processed in other order. - LimboPlayer limboPlayer = limboCache.getLimboPlayer(name); - if (limboPlayer != null) { - if (limboPlayer.getTimeoutTask() != null) { - limboPlayer.getTimeoutTask().cancel(); - } - if (limboPlayer.getMessageTask() != null) { - limboPlayer.getMessageTask().cancel(); - } + PlayerData playerData = limboCache.getPlayerData(name); + if (playerData != null) { + playerData.clearTasks(); } syncProcessManager.processSyncPlayerLogin(player); } else if (player.isOnline()) { @@ -224,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 1752e33b..2d2f938c 100644 --- a/src/main/java/fr/xephi/authme/process/login/ProcessSyncPlayerLogin.java +++ b/src/main/java/fr/xephi/authme/process/login/ProcessSyncPlayerLogin.java @@ -2,25 +2,16 @@ package fr.xephi.authme.process.login; import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteStreams; - import fr.xephi.authme.AuthMe; -import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.limbo.LimboCache; -import fr.xephi.authme.cache.limbo.LimboPlayer; -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.permission.AuthGroupType; 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.settings.properties.RestrictionSettings; 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; @@ -47,37 +38,20 @@ 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() { } - - - private void restoreSpeedEffects(Player player) { - if (!service.getProperty(RestrictionSettings.ALLOW_UNAUTHED_MOVEMENT) - && service.getProperty(RestrictionSettings.REMOVE_SPEED)) { - player.setWalkSpeed(0.2F); - player.setFlySpeed(0.1F); - } + ProcessSyncPlayerLogin() { } private void restoreInventory(Player player) { RestoreInventoryEvent event = new RestoreInventoryEvent(player); pluginManager.callEvent(event); if (!event.isCancelled()) { - protocolLibService.sendInventoryPacket(player); + player.updateInventory(); } } @@ -94,16 +68,12 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess { public void processPlayerLogin(Player player) { final String name = player.getName().toLowerCase(); // Limbo contains the State of the Player before /login - final LimboPlayer limbo = limboCache.getLimboPlayer(name); - final PlayerAuth auth = dataSource.getAuth(name); - - if (limbo != null) { - // Restore Op state and Permission Group - restoreOpState(player, limbo); - service.setGroup(player, AuthGroupType.LOGGED_IN); - - teleportationService.teleportOnLogin(player, auth, limbo); - + if (limboCache.hasPlayerData(name)) { + limboCache.restoreData(player); + limboCache.deletePlayerData(player); + // do we really need to use location from database for now? + // because LimboCache#restoreData teleport player to last location. + //teleportationService.teleportOnLogin(player, auth, limbo); if (RESTORE_COLLISIONS && !service.getProperty(KEEP_COLLISIONS_DISABLED)) { player.setCollidable(true); } @@ -111,9 +81,6 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess { if (service.getProperty(PROTECT_INVENTORY_BEFORE_LOGIN)) { restoreInventory(player); } - - // Clean up no longer used temporary data - limboCache.deleteLimboPlayer(name); } // We can now display the join message (if delayed) @@ -129,7 +96,6 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess { AuthMePlayerListener.joinMessage.remove(name); } - restoreSpeedEffects(player); if (service.getProperty(RegistrationSettings.APPLY_BLIND_EFFECT)) { player.removePotionEffect(PotionEffectType.BLINDNESS); } @@ -138,6 +104,7 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess { bukkitService.callEvent(new LoginEvent(player)); player.saveData(); sendBungeeMessage(player); + // Login is done, display welcome message if (service.getProperty(RegistrationSettings.USE_WELCOME_MESSAGE)) { if (service.getProperty(RegistrationSettings.BROADCAST_WELCOME_MESSAGE)) { @@ -157,15 +124,11 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess { sendTo(player); } - private void restoreOpState(Player player, LimboPlayer limboPlayer) { - player.setOp(limboPlayer.isOperator()); - } - private void sendTo(Player player) { - if(!service.getProperty(HooksSettings.BUNGEECORD)) { + if (!service.getProperty(HooksSettings.BUNGEECORD)) { return; } - if(service.getProperty(HooksSettings.BUNGEECORD_SERVER).isEmpty()) { + if (service.getProperty(HooksSettings.BUNGEECORD_SERVER).isEmpty()) { return; } @@ -176,7 +139,7 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess { } private void sendBungeeMessage(Player player) { - if(!service.getProperty(HooksSettings.BUNGEECORD)) { + if (!service.getProperty(HooksSettings.BUNGEECORD)) { return; } 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 fc81017d..209ec480 100644 --- a/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java +++ b/src/main/java/fr/xephi/authme/process/logout/AsynchronousLogout.java @@ -5,12 +5,10 @@ import fr.xephi.authme.cache.auth.PlayerCache; import fr.xephi.authme.cache.limbo.LimboCache; import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.output.MessageKey; -import fr.xephi.authme.permission.AuthGroupType; import fr.xephi.authme.process.AsynchronousProcess; import fr.xephi.authme.process.ProcessService; import fr.xephi.authme.process.SyncProcessManager; -import fr.xephi.authme.util.BukkitService; -import fr.xephi.authme.util.Utils; +import fr.xephi.authme.settings.properties.RestrictionSettings; import org.bukkit.entity.Player; import javax.inject.Inject; @@ -32,10 +30,8 @@ public class AsynchronousLogout implements AsynchronousProcess { @Inject private SyncProcessManager syncProcessManager; - @Inject - private BukkitService bukkitService; - - AsynchronousLogout() { } + AsynchronousLogout() { + } public void logout(final Player player) { final String name = player.getName().toLowerCase(); @@ -43,27 +39,20 @@ public class AsynchronousLogout implements AsynchronousProcess { service.send(player, MessageKey.NOT_LOGGED_IN); return; } + PlayerAuth auth = playerCache.getAuth(name); database.updateSession(auth); - auth.setQuitLocX(player.getLocation().getX()); - auth.setQuitLocY(player.getLocation().getY()); - auth.setQuitLocZ(player.getLocation().getZ()); - auth.setWorld(player.getWorld().getName()); - database.updateQuitLoc(auth); + if (service.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) { + auth.setQuitLocX(player.getLocation().getX()); + auth.setQuitLocY(player.getLocation().getY()); + auth.setQuitLocZ(player.getLocation().getZ()); + auth.setWorld(player.getWorld().getName()); + database.updateQuitLoc(auth); + } + limboCache.addPlayerData(player); playerCache.removePlayer(name); database.setUnlogged(name); - bukkitService.scheduleSyncDelayedTask(new Runnable() { - @Override - public void run() { - Utils.teleportToSpawn(player); - } - }); - if (limboCache.hasLimboPlayer(name)) { - limboCache.deleteLimboPlayer(name); - } - limboCache.addLimboPlayer(player); - service.setGroup(player, AuthGroupType.NOT_LOGGED_IN); syncProcessManager.processSyncPlayerLogout(player); } } diff --git a/src/main/java/fr/xephi/authme/process/logout/ProcessSynchronousPlayerLogout.java b/src/main/java/fr/xephi/authme/process/logout/ProcessSynchronousPlayerLogout.java index 6a36ab44..9db73b0d 100644 --- a/src/main/java/fr/xephi/authme/process/logout/ProcessSynchronousPlayerLogout.java +++ b/src/main/java/fr/xephi/authme/process/logout/ProcessSynchronousPlayerLogout.java @@ -8,12 +8,13 @@ import fr.xephi.authme.cache.SessionManager; import fr.xephi.authme.events.LogoutEvent; 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; import fr.xephi.authme.process.SynchronousProcess; 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.task.LimboPlayerTaskManager; +import fr.xephi.authme.task.PlayerDataTaskManager; import fr.xephi.authme.util.BukkitService; import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; @@ -39,12 +40,13 @@ public class ProcessSynchronousPlayerLogout implements SynchronousProcess { private ProtocolLibService protocolLibService; @Inject - private LimboPlayerTaskManager limboPlayerTaskManager; + private PlayerDataTaskManager playerDataTaskManager; @Inject private SessionManager sessionManager; - ProcessSynchronousPlayerLogout() { } + ProcessSynchronousPlayerLogout() { + } private void sendBungeeMessage(Player player) { @@ -56,14 +58,6 @@ public class ProcessSynchronousPlayerLogout implements SynchronousProcess { player.sendPluginMessage(plugin, "BungeeCord", out.toByteArray()); } - private void restoreSpeedEffect(Player player) { - if (!service.getProperty(RestrictionSettings.ALLOW_UNAUTHED_MOVEMENT) - && service.getProperty(RestrictionSettings.REMOVE_SPEED)) { - player.setFlySpeed(0.0f); - player.setWalkSpeed(0.0f); - } - } - public void processSyncLogout(Player player) { final String name = player.getName().toLowerCase(); if (sessionManager.hasSession(name)) { @@ -73,18 +67,11 @@ public class ProcessSynchronousPlayerLogout implements SynchronousProcess { protocolLibService.sendBlankInventoryPacket(player); } - limboPlayerTaskManager.registerTimeoutTask(player); - limboPlayerTaskManager.registerMessageTask(name, true); + playerDataTaskManager.registerTimeoutTask(player); + playerDataTaskManager.registerMessageTask(name, true); + + applyLogoutEffect(player); - if (player.isInsideVehicle() && player.getVehicle() != null) { - player.getVehicle().eject(); - } - final int timeout = service.getProperty(RestrictionSettings.TIMEOUT) * TICKS_PER_SECOND; - if (service.getProperty(RegistrationSettings.APPLY_BLIND_EFFECT)) { - player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, timeout, 2)); - } - player.setOp(false); - restoreSpeedEffect(player); // Player is now logout... Time to fire event ! bukkitService.callEvent(new LogoutEvent(player)); if (service.getProperty(HooksSettings.BUNGEECORD)) { @@ -94,4 +81,26 @@ public class ProcessSynchronousPlayerLogout implements SynchronousProcess { ConsoleLogger.info(player.getName() + " logged out"); } + private void applyLogoutEffect(Player player) { + // dismount player + player.leaveVehicle(); + + // Apply Blindness effect + final int timeout = service.getProperty(RestrictionSettings.TIMEOUT) * TICKS_PER_SECOND; + if (service.getProperty(RegistrationSettings.APPLY_BLIND_EFFECT)) { + player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, timeout, 2)); + } + + // Set player's data to unauthenticated + service.setGroup(player, AuthGroupType.NOT_LOGGED_IN); + player.setOp(false); + player.setAllowFlight(false); + // Remove speed + if (!service.getProperty(RestrictionSettings.ALLOW_UNAUTHED_MOVEMENT) + && service.getProperty(RestrictionSettings.REMOVE_SPEED)) { + player.setFlySpeed(0.0f); + player.setWalkSpeed(0.0f); + } + } + } diff --git a/src/main/java/fr/xephi/authme/process/quit/AsynchronousQuit.java b/src/main/java/fr/xephi/authme/process/quit/AsynchronousQuit.java index c1aac0c6..a674fe3e 100644 --- a/src/main/java/fr/xephi/authme/process/quit/AsynchronousQuit.java +++ b/src/main/java/fr/xephi/authme/process/quit/AsynchronousQuit.java @@ -4,16 +4,15 @@ import fr.xephi.authme.AuthMe; import fr.xephi.authme.cache.SessionManager; import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerCache; -import fr.xephi.authme.cache.limbo.LimboCache; -import fr.xephi.authme.cache.limbo.LimboPlayer; import fr.xephi.authme.datasource.CacheDataSource; import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.process.AsynchronousProcess; import fr.xephi.authme.process.ProcessService; import fr.xephi.authme.process.SyncProcessManager; +import fr.xephi.authme.settings.SpawnLoader; import fr.xephi.authme.settings.properties.PluginSettings; import fr.xephi.authme.settings.properties.RestrictionSettings; -import fr.xephi.authme.util.StringUtils; +import fr.xephi.authme.util.BukkitService; import fr.xephi.authme.util.Utils; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -37,16 +36,20 @@ public class AsynchronousQuit implements AsynchronousProcess { @Inject private PlayerCache playerCache; - @Inject - private LimboCache limboCache; - @Inject private SyncProcessManager syncProcessManager; @Inject private SessionManager sessionManager; - AsynchronousQuit() { } + @Inject + private SpawnLoader spawnLoader; + + @Inject + private BukkitService bukkitService; + + AsynchronousQuit() { + } public void processQuit(Player player, boolean isKick) { @@ -56,10 +59,9 @@ public class AsynchronousQuit implements AsynchronousProcess { final String name = player.getName().toLowerCase(); String ip = Utils.getPlayerIp(player); - if (playerCache.isAuthenticated(name)) { if (service.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) { - Location loc = player.getLocation(); + Location loc = spawnLoader.getPlayerLocationOrSpawn(player); PlayerAuth auth = PlayerAuth.builder() .name(name).location(loc) .realName(player.getName()).build(); @@ -74,24 +76,11 @@ public class AsynchronousQuit implements AsynchronousProcess { database.updateSession(auth); } - boolean needToChange = false; - boolean isOp = false; - - LimboPlayer limbo = limboCache.getLimboPlayer(name); - if (limbo != null) { - if (!StringUtils.isEmpty(limbo.getGroup())) { - Utils.addNormal(player, limbo.getGroup()); - } - needToChange = true; - isOp = limbo.isOperator(); - limboCache.deleteLimboPlayer(name); - } - //always unauthenticate the player - use session only for auto logins on the same ip playerCache.removePlayer(name); if (plugin.isEnabled() && service.getProperty(PluginSettings.SESSIONS_ENABLED)) { - BukkitTask task = plugin.getServer().getScheduler().runTaskLaterAsynchronously(plugin, new Runnable() { + BukkitTask task = bukkitService.runTaskLaterAsynchronously(new Runnable() { @Override public void run() { @@ -110,7 +99,7 @@ public class AsynchronousQuit implements AsynchronousProcess { database.setUnlogged(name); if (plugin.isEnabled()) { - syncProcessManager.processSyncPlayerQuit(player, isOp, needToChange); + syncProcessManager.processSyncPlayerQuit(player); } // remove player from cache if (database instanceof CacheDataSource) { 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 c1382c2c..27f46071 100644 --- a/src/main/java/fr/xephi/authme/process/quit/ProcessSyncronousPlayerQuit.java +++ b/src/main/java/fr/xephi/authme/process/quit/ProcessSyncronousPlayerQuit.java @@ -1,15 +1,32 @@ package fr.xephi.authme.process.quit; +import fr.xephi.authme.cache.backup.PlayerDataStorage; +import fr.xephi.authme.cache.limbo.LimboCache; import fr.xephi.authme.process.SynchronousProcess; import org.bukkit.entity.Player; +import javax.inject.Inject; + public class ProcessSyncronousPlayerQuit implements SynchronousProcess { - public void processSyncQuit(Player player, boolean isOp, boolean needToChange) { - if (needToChange) { - player.setOp(isOp); + @Inject + private PlayerDataStorage playerDataStorage; + + @Inject + private LimboCache limboCache; + + public void processSyncQuit(Player player) { + if (limboCache.hasPlayerData(player.getName())) { // it mean player is not authenticated + limboCache.restoreData(player); + limboCache.removeFromCache(player); + } else { + // Save player's data, so we could retrieve it later on player next join + if (!playerDataStorage.hasData(player)) { + playerDataStorage.saveData(player); + } } + player.leaveVehicle(); } } diff --git a/src/main/java/fr/xephi/authme/process/register/ProcessSyncEmailRegister.java b/src/main/java/fr/xephi/authme/process/register/ProcessSyncEmailRegister.java index 41d8fe97..8680bc82 100644 --- a/src/main/java/fr/xephi/authme/process/register/ProcessSyncEmailRegister.java +++ b/src/main/java/fr/xephi/authme/process/register/ProcessSyncEmailRegister.java @@ -7,7 +7,7 @@ import fr.xephi.authme.process.ProcessService; import fr.xephi.authme.process.SynchronousProcess; import fr.xephi.authme.settings.Settings; import fr.xephi.authme.settings.properties.SecuritySettings; -import fr.xephi.authme.task.LimboPlayerTaskManager; +import fr.xephi.authme.task.PlayerDataTaskManager; import fr.xephi.authme.util.Utils; import org.bukkit.entity.Player; @@ -20,7 +20,7 @@ public class ProcessSyncEmailRegister implements SynchronousProcess { private ProcessService service; @Inject - private LimboPlayerTaskManager limboPlayerTaskManager; + private PlayerDataTaskManager playerDataTaskManager; ProcessSyncEmailRegister() { } @@ -32,8 +32,8 @@ public class ProcessSyncEmailRegister implements SynchronousProcess { } service.send(player, MessageKey.ACCOUNT_NOT_ACTIVATED); - limboPlayerTaskManager.registerTimeoutTask(player); - limboPlayerTaskManager.registerMessageTask(name, true); + playerDataTaskManager.registerTimeoutTask(player); + playerDataTaskManager.registerMessageTask(name, true); player.saveData(); if (!service.getProperty(SecuritySettings.REMOVE_SPAM_FROM_CONSOLE)) { 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 94b35304..ae40f681 100644 --- a/src/main/java/fr/xephi/authme/process/register/ProcessSyncPasswordRegister.java +++ b/src/main/java/fr/xephi/authme/process/register/ProcessSyncPasswordRegister.java @@ -5,10 +5,8 @@ import com.google.common.io.ByteStreams; import fr.xephi.authme.AuthMe; import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.cache.limbo.LimboCache; -import fr.xephi.authme.cache.limbo.LimboPlayer; 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; @@ -18,7 +16,7 @@ import fr.xephi.authme.settings.properties.EmailSettings; import fr.xephi.authme.settings.properties.HooksSettings; import fr.xephi.authme.settings.properties.RegistrationSettings; import fr.xephi.authme.settings.properties.SecuritySettings; -import fr.xephi.authme.task.LimboPlayerTaskManager; +import fr.xephi.authme.task.PlayerDataTaskManager; import fr.xephi.authme.util.BukkitService; import fr.xephi.authme.util.Utils; import org.bukkit.Bukkit; @@ -42,16 +40,14 @@ public class ProcessSyncPasswordRegister implements SynchronousProcess { @Inject private BukkitService bukkitService; - @Inject - private ProtocolLibService protocolLibService; - @Inject private LimboCache limboCache; @Inject - private LimboPlayerTaskManager limboPlayerTaskManager; + private PlayerDataTaskManager playerDataTaskManager; - ProcessSyncPasswordRegister() { } + ProcessSyncPasswordRegister() { + } private void sendBungeeMessage(Player player) { @@ -69,7 +65,7 @@ public class ProcessSyncPasswordRegister implements SynchronousProcess { } for (String command : service.getProperty(RegistrationSettings.FORCE_REGISTER_COMMANDS_AS_CONSOLE)) { Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), - command.replace("%p", player.getName())); + command.replace("%p", player.getName())); } } @@ -80,11 +76,9 @@ public class ProcessSyncPasswordRegister implements SynchronousProcess { */ private void requestLogin(Player player) { final String name = player.getName().toLowerCase(); - Utils.teleportToSpawn(player); - - limboCache.updateLimboPlayer(player); - limboPlayerTaskManager.registerTimeoutTask(player); - limboPlayerTaskManager.registerMessageTask(name, true); + limboCache.updatePlayerData(player); + playerDataTaskManager.registerTimeoutTask(player); + playerDataTaskManager.registerMessageTask(name, true); if (player.isInsideVehicle() && player.getVehicle() != null) { player.getVehicle().eject(); @@ -93,19 +87,16 @@ public class ProcessSyncPasswordRegister implements SynchronousProcess { public void processPasswordRegister(Player player) { final String name = player.getName().toLowerCase(); - LimboPlayer limbo = limboCache.getLimboPlayer(name); - if (limbo != null) { - Utils.teleportToSpawn(player); - + if (limboCache.hasPlayerData(name)) { if (service.getProperty(PROTECT_INVENTORY_BEFORE_LOGIN)) { RestoreInventoryEvent event = new RestoreInventoryEvent(player); bukkitService.callEvent(event); if (!event.isCancelled()) { - protocolLibService.sendInventoryPacket(player); + player.updateInventory(); } } - - limboCache.deleteLimboPlayer(name); + limboCache.restoreData(player); + limboCache.deletePlayerData(player); } if (!Settings.getRegisteredGroup.isEmpty()) { diff --git a/src/main/java/fr/xephi/authme/process/unregister/AsynchronousUnregister.java b/src/main/java/fr/xephi/authme/process/unregister/AsynchronousUnregister.java index b9b87252..7224fd75 100644 --- a/src/main/java/fr/xephi/authme/process/unregister/AsynchronousUnregister.java +++ b/src/main/java/fr/xephi/authme/process/unregister/AsynchronousUnregister.java @@ -13,8 +13,8 @@ import fr.xephi.authme.security.PasswordSecurity; import fr.xephi.authme.settings.Settings; import fr.xephi.authme.settings.properties.RegistrationSettings; import fr.xephi.authme.settings.properties.RestrictionSettings; -import fr.xephi.authme.task.LimboPlayerTaskManager; -import fr.xephi.authme.util.Utils; +import fr.xephi.authme.task.PlayerDataTaskManager; +import fr.xephi.authme.util.TeleportationService; import org.bukkit.entity.Player; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; @@ -41,7 +41,10 @@ public class AsynchronousUnregister implements AsynchronousProcess { private LimboCache limboCache; @Inject - private LimboPlayerTaskManager limboPlayerTaskManager; + private PlayerDataTaskManager playerDataTaskManager; + + @Inject + private TeleportationService teleportationService; AsynchronousUnregister() { } @@ -56,18 +59,19 @@ public class AsynchronousUnregister implements AsynchronousProcess { } if (service.getProperty(RegistrationSettings.FORCE)) { - Utils.teleportToSpawn(player); + teleportationService.teleportOnJoin(player); player.saveData(); playerCache.removePlayer(player.getName().toLowerCase()); if (!Settings.getRegisteredGroup.isEmpty()) { service.setGroup(player, AuthGroupType.UNREGISTERED); } - limboCache.addLimboPlayer(player); - limboPlayerTaskManager.registerTimeoutTask(player); - limboPlayerTaskManager.registerMessageTask(name, false); + limboCache.deletePlayerData(player); + limboCache.addPlayerData(player); + playerDataTaskManager.registerTimeoutTask(player); + playerDataTaskManager.registerMessageTask(name, false); service.send(player, MessageKey.UNREGISTERED_SUCCESS); - ConsoleLogger.info(player.getDisplayName() + " unregistered himself"); + ConsoleLogger.info(player.getName() + " unregistered himself"); return; // TODO ljacqu 20160612: Why return here? No blind effect? Player not removed from PlayerCache? } if (!Settings.unRegisteredGroup.isEmpty()) { @@ -81,7 +85,7 @@ public class AsynchronousUnregister implements AsynchronousProcess { player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, timeout, 2)); } service.send(player, MessageKey.UNREGISTERED_SUCCESS); - ConsoleLogger.info(player.getDisplayName() + " unregistered himself"); + ConsoleLogger.info(player.getName() + " unregistered himself"); } else { service.send(player, MessageKey.WRONG_PASSWORD); } diff --git a/src/main/java/fr/xephi/authme/security/crypts/EncryptionMethod.java b/src/main/java/fr/xephi/authme/security/crypts/EncryptionMethod.java index b1c0b003..83cc6c8c 100644 --- a/src/main/java/fr/xephi/authme/security/crypts/EncryptionMethod.java +++ b/src/main/java/fr/xephi/authme/security/crypts/EncryptionMethod.java @@ -3,9 +3,7 @@ package fr.xephi.authme.security.crypts; /** * Public interface for custom password encryption methods. *
- * Note that {@link fr.xephi.authme.security.PasswordSecurity} requires classes implementing this interface
- * to either have the default constructor or an accessible constructor with one parameter of type
- * {@link fr.xephi.authme.settings.NewSetting}.
+ * Instantiation of these methods is done via automatic dependency injection.
*/
public interface EncryptionMethod {
diff --git a/src/main/java/fr/xephi/authme/settings/Settings.java b/src/main/java/fr/xephi/authme/settings/Settings.java
index d13fc4de..5682fae2 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,18 +15,12 @@ import java.util.List;
public final class Settings {
public static List
+ * Returns a task that will run asynchronously after the specified number
+ * of server ticks.
+ *
+ * @param task the task to be run
+ * @param delay the ticks to wait before running the task
+ * @return a BukkitTask that contains the id number
+ * @throws IllegalArgumentException if plugin is null
+ * @throws IllegalArgumentException if task is null
+ */
+ public BukkitTask runTaskLaterAsynchronously(Runnable task, long delay) {
+ return Bukkit.getScheduler().runTaskLaterAsynchronously(authMe, task, delay);
+ }
+
/**
* Broadcast a message to all players.
*
diff --git a/src/main/java/fr/xephi/authme/util/FileUtils.java b/src/main/java/fr/xephi/authme/util/FileUtils.java
index d34c41f8..bd9c7fb9 100644
--- a/src/main/java/fr/xephi/authme/util/FileUtils.java
+++ b/src/main/java/fr/xephi/authme/util/FileUtils.java
@@ -22,7 +22,8 @@ public class FileUtils {
* Copy a resource file (from the JAR) to the given file if it doesn't exist.
*
* @param destinationFile The file to check and copy to (outside of JAR)
- * @param resourcePath Absolute path to the resource file (path to file within JAR)
+ * @param resourcePath Absolute path to the resource file (path to file within JAR)
+ *
* @return False if the file does not exist and could not be copied, true otherwise
*/
public static boolean copyFileFromResource(File destinationFile, String resourcePath) {
@@ -49,4 +50,25 @@ public class FileUtils {
}
return false;
}
+
+ /**
+ * Delete a given directory and all its content.
+ *
+ * @param directory The directory to remove
+ */
+ public static void purgeDirectory(File directory) {
+ if (!directory.isDirectory()) {
+ return;
+ }
+ File[] files = directory.listFiles();
+ if (files == null) {
+ return;
+ }
+ for (File target : files) {
+ if (target.isDirectory()) {
+ purgeDirectory(target);
+ }
+ target.delete();
+ }
+ }
}
diff --git a/src/main/java/fr/xephi/authme/util/TeleportationService.java b/src/main/java/fr/xephi/authme/util/TeleportationService.java
index 06c7558d..edd0468d 100644
--- a/src/main/java/fr/xephi/authme/util/TeleportationService.java
+++ b/src/main/java/fr/xephi/authme/util/TeleportationService.java
@@ -2,7 +2,8 @@ package fr.xephi.authme.util;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.cache.auth.PlayerCache;
-import fr.xephi.authme.cache.limbo.LimboPlayer;
+import fr.xephi.authme.cache.limbo.PlayerData;
+import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.events.AbstractTeleportEvent;
import fr.xephi.authme.events.AuthMeTeleportEvent;
import fr.xephi.authme.events.FirstSpawnTeleportEvent;
@@ -39,10 +40,13 @@ public class TeleportationService implements Reloadable {
@Inject
private PlayerCache playerCache;
+ @Inject
+ private DataSource dataSource;
+
private Set
+ * Note: this is triggered by Bukkit's PlayerLoginEvent, during which you cannot use
+ * {@link Player#hasPlayedBefore()}: it always returns {@code false}. We trigger teleportation
+ * from the PlayerLoginEvent and not the PlayerJoinEvent to ensure that the location is overridden
+ * as fast as possible (cf. AuthMe #682).
+ *
+ * @param player the player to process
+ * @see BUKKIT-3521: Player.hasPlayedBefore() always false
+ */
public void teleportOnJoin(final Player player) {
if (settings.getProperty(RestrictionSettings.NO_TELEPORT)) {
return;
- } else if (teleportToFirstSpawn(player)) {
- return;
}
if (settings.getProperty(TELEPORT_UNAUTHED_TO_SPAWN) || mustForceSpawnAfterLogin(player.getWorld().getName())) {
@@ -63,13 +76,40 @@ public class TeleportationService implements Reloadable {
}
}
- public void teleportOnLogin(final Player player, PlayerAuth auth, LimboPlayer limbo) {
+ /**
+ * Teleports the player to the first spawn if he is new and the first spawn is configured.
+ *
+ * @param player the player to process
+ */
+ public void teleportNewPlayerToFirstSpawn(final Player player) {
if (settings.getProperty(RestrictionSettings.NO_TELEPORT)) {
return;
}
- // The world in LimboPlayer is from where the player comes, before any teleportation by AuthMe
- String worldName = limbo.getLoc().getWorld().getName();
+ Location firstSpawn = spawnLoader.getFirstSpawn();
+ if (firstSpawn == null) {
+ return;
+ }
+
+ if (!player.hasPlayedBefore() || !dataSource.isAuthAvailable(player.getName())) {
+ performTeleportation(player, new FirstSpawnTeleportEvent(player, firstSpawn));
+ }
+ }
+
+ /**
+ * Teleports the player according to the settings after having successfully logged in.
+ *
+ * @param player the player
+ * @param auth corresponding PlayerAuth object
+ * @param limbo corresponding PlayerData object
+ */
+ public void teleportOnLogin(final Player player, PlayerAuth auth, PlayerData limbo) {
+ if (settings.getProperty(RestrictionSettings.NO_TELEPORT)) {
+ return;
+ }
+
+ // The world in PlayerData is from where the player comes, before any teleportation by AuthMe
+ String worldName = limbo.getLocation().getWorld().getName();
if (mustForceSpawnAfterLogin(worldName)) {
teleportToSpawn(player, true);
} else if (settings.getProperty(TELEPORT_UNAUTHED_TO_SPAWN)) {
@@ -77,7 +117,7 @@ public class TeleportationService implements Reloadable {
Location location = buildLocationFromAuth(player, auth);
teleportBackFromSpawn(player, location);
} else {
- teleportBackFromSpawn(player, limbo.getLoc());
+ teleportBackFromSpawn(player, limbo.getLocation());
}
}
}
@@ -95,19 +135,6 @@ public class TeleportationService implements Reloadable {
return new Location(world, auth.getQuitLocX(), auth.getQuitLocY(), auth.getQuitLocZ());
}
- private boolean teleportToFirstSpawn(final Player player) {
- if (player.hasPlayedBefore()) {
- return false;
- }
- Location firstSpawn = spawnLoader.getFirstSpawn();
- if (firstSpawn == null) {
- return false;
- }
-
- performTeleportation(player, new FirstSpawnTeleportEvent(player, firstSpawn));
- return true;
- }
-
private void teleportBackFromSpawn(final Player player, final Location location) {
performTeleportation(player, new AuthMeTeleportEvent(player, location));
}
@@ -122,7 +149,7 @@ public class TeleportationService implements Reloadable {
* by external listeners). Note that not teleportation is performed if the event's location is empty.
*
* @param player the player to teleport
- * @param event the event to emit and according to which to teleport
+ * @param event the event to emit and according to which to teleport
*/
private void performTeleportation(final Player player, final AbstractTeleportEvent event) {
bukkitService.scheduleSyncDelayedTask(new Runnable() {
diff --git a/src/main/java/fr/xephi/authme/util/Utils.java b/src/main/java/fr/xephi/authme/util/Utils.java
index d26ae366..899d2d6c 100644
--- a/src/main/java/fr/xephi/authme/util/Utils.java
+++ b/src/main/java/fr/xephi/authme/util/Utils.java
@@ -1,15 +1,10 @@
package fr.xephi.authme.util;
-import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger;
-import fr.xephi.authme.events.AuthMeTeleportEvent;
-import fr.xephi.authme.permission.PermissionsManager;
import fr.xephi.authme.settings.Settings;
-import org.bukkit.Location;
import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
-import java.util.Arrays;
import java.util.regex.Pattern;
/**
@@ -17,41 +12,9 @@ import java.util.regex.Pattern;
*/
public final class Utils {
- private static AuthMe plugin = AuthMe.getInstance();
-
private Utils() {
}
- /**
- * TODO: This method requires better explanation.
- *
- * Set the normal group of a player.
- *
- * @param player The player.
- * @param group The normal group.
- *
- * @return True on success, false on failure.
- */
- public static boolean addNormal(Player player, String group) {
- if (!Settings.isPermissionCheckEnabled) {
- return false;
- }
-
- // Get the permissions manager, and make sure it's valid
- PermissionsManager permsMan = plugin.getPermissionsManager();
- if (permsMan == null) {
- ConsoleLogger.showError("Failed to access permissions manager instance, aborting.");
- return false;
- }
-
- // Remove old groups
- permsMan.removeGroups(player, Arrays.asList(Settings.unRegisteredGroup,
- Settings.getRegisteredGroup, Settings.getUnloggedinGroup));
-
- // Add the normal group, return the result
- return permsMan.addGroup(player, group);
- }
-
@Deprecated
public static boolean isUnrestricted(Player player) {
// TODO ljacqu 20160602: Checking for Settings.isAllowRestrictedIp is wrong! Nothing in the config suggests
@@ -60,19 +23,16 @@ public final class Utils {
&& Settings.getUnrestrictedName.contains(player.getName().toLowerCase());
}
- @Deprecated
- public static void teleportToSpawn(Player player) {
- if (Settings.isTeleportToSpawnEnabled && !Settings.noTeleport) {
- Location spawn = plugin.getSpawnLocation(player);
- AuthMeTeleportEvent tpEvent = new AuthMeTeleportEvent(player, spawn);
- plugin.getServer().getPluginManager().callEvent(tpEvent);
- if (!tpEvent.isCancelled()) {
- player.teleport(tpEvent.getTo());
- }
- }
- }
-
+ /**
+ * Get player's UUID if can, name otherwise.
+ *
+ * @param player Player to retrieve
+ *
+ * @return player's UUID or Name in String.
+ */
public static String getUUIDorName(OfflinePlayer player) {
+ // We may made this configurable in future
+ // so we can have uuid support.
try {
return player.getUniqueId().toString();
} catch (Exception ignore) {
@@ -80,6 +40,13 @@ public final class Utils {
}
}
+ /**
+ * Compile Pattern sneaky without throwing Exception.
+ *
+ * @param pattern pattern string to compile
+ *
+ * @return the given regex compiled into Pattern object.
+ */
public static Pattern safePatternCompile(String pattern) {
try {
return Pattern.compile(pattern);
diff --git a/src/test/java/fr/xephi/authme/command/executable/authme/RegisterAdminCommandTest.java b/src/test/java/fr/xephi/authme/command/executable/authme/RegisterAdminCommandTest.java
index 441a38a2..315a807c 100644
--- a/src/test/java/fr/xephi/authme/command/executable/authme/RegisterAdminCommandTest.java
+++ b/src/test/java/fr/xephi/authme/command/executable/authme/RegisterAdminCommandTest.java
@@ -2,6 +2,7 @@ package fr.xephi.authme.command.executable.authme;
import fr.xephi.authme.TestHelper;
import fr.xephi.authme.cache.auth.PlayerAuth;
+import fr.xephi.authme.cache.limbo.LimboCache;
import fr.xephi.authme.command.CommandService;
import fr.xephi.authme.datasource.DataSource;
import fr.xephi.authme.output.MessageKey;
@@ -54,6 +55,9 @@ public class RegisterAdminCommandTest {
@Mock
private ValidationService validationService;
+ @Mock
+ private LimboCache limboCache;
+
@BeforeClass
public static void setUpLogger() {
TestHelper.setupLogger();
diff --git a/src/test/java/fr/xephi/authme/task/LimboPlayerTaskManagerTest.java b/src/test/java/fr/xephi/authme/task/PlayerDataTaskManagerTest.java
similarity index 72%
rename from src/test/java/fr/xephi/authme/task/LimboPlayerTaskManagerTest.java
rename to src/test/java/fr/xephi/authme/task/PlayerDataTaskManagerTest.java
index 51e390c4..19fccd65 100644
--- a/src/test/java/fr/xephi/authme/task/LimboPlayerTaskManagerTest.java
+++ b/src/test/java/fr/xephi/authme/task/PlayerDataTaskManagerTest.java
@@ -3,7 +3,7 @@ package fr.xephi.authme.task;
import fr.xephi.authme.TestHelper;
import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.cache.limbo.LimboCache;
-import fr.xephi.authme.cache.limbo.LimboPlayer;
+import fr.xephi.authme.cache.limbo.PlayerData;
import fr.xephi.authme.output.MessageKey;
import fr.xephi.authme.output.Messages;
import fr.xephi.authme.settings.NewSetting;
@@ -28,13 +28,13 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
/**
- * Test for {@link LimboPlayerTaskManager}.
+ * Test for {@link PlayerDataTaskManager}.
*/
@RunWith(MockitoJUnitRunner.class)
-public class LimboPlayerTaskManagerTest {
+public class PlayerDataTaskManagerTest {
@InjectMocks
- private LimboPlayerTaskManager limboPlayerTaskManager;
+ private PlayerDataTaskManager playerDataTaskManager;
@Mock
private Messages messages;
@@ -60,8 +60,8 @@ public class LimboPlayerTaskManagerTest {
public void shouldRegisterMessageTask() {
// given
String name = "bobby";
- LimboPlayer limboPlayer = mock(LimboPlayer.class);
- given(limboCache.getLimboPlayer(name)).willReturn(limboPlayer);
+ PlayerData playerData = mock(PlayerData.class);
+ given(limboCache.getPlayerData(name)).willReturn(playerData);
MessageKey key = MessageKey.REGISTER_EMAIL_MESSAGE;
given(messages.retrieve(key)).willReturn(new String[]{"Please register!"});
BukkitTask bukkiTask = mock(BukkitTask.class);
@@ -70,10 +70,10 @@ public class LimboPlayerTaskManagerTest {
given(settings.getProperty(RegistrationSettings.USE_EMAIL_REGISTRATION)).willReturn(true);
// when
- limboPlayerTaskManager.registerMessageTask(name, false);
+ playerDataTaskManager.registerMessageTask(name, false);
// then
- verify(limboPlayer).setMessageTask(bukkiTask);
+ verify(playerData).setMessageTask(bukkiTask);
verify(messages).retrieve(key);
}
@@ -81,14 +81,14 @@ public class LimboPlayerTaskManagerTest {
public void shouldNotScheduleTaskForMissingLimboPlayer() {
// given
String name = "ghost";
- given(limboCache.getLimboPlayer(name)).willReturn(null);
+ given(limboCache.getPlayerData(name)).willReturn(null);
given(settings.getProperty(RegistrationSettings.MESSAGE_INTERVAL)).willReturn(5);
// when
- limboPlayerTaskManager.registerMessageTask(name, true);
+ playerDataTaskManager.registerMessageTask(name, true);
// then
- verify(limboCache).getLimboPlayer(name);
+ verify(limboCache).getPlayerData(name);
verifyZeroInteractions(bukkitService);
verifyZeroInteractions(messages);
}
@@ -97,28 +97,28 @@ public class LimboPlayerTaskManagerTest {
public void shouldNotScheduleTaskForZeroAsInterval() {
// given
String name = "Tester1";
- LimboPlayer limboPlayer = mock(LimboPlayer.class);
- given(limboCache.getLimboPlayer(name)).willReturn(limboPlayer);
+ PlayerData playerData = mock(PlayerData.class);
+ given(limboCache.getPlayerData(name)).willReturn(playerData);
BukkitTask bukkiTask = mock(BukkitTask.class);
given(bukkitService.runTask(any(MessageTask.class))).willReturn(bukkiTask);
given(settings.getProperty(RegistrationSettings.MESSAGE_INTERVAL)).willReturn(0);
// when
- limboPlayerTaskManager.registerMessageTask(name, true);
+ playerDataTaskManager.registerMessageTask(name, true);
// then
- verifyZeroInteractions(limboPlayer, bukkitService);
+ verifyZeroInteractions(playerData, bukkitService);
}
@Test
public void shouldCancelExistingMessageTask() {
// given
- LimboPlayer limboPlayer = mock(LimboPlayer.class);
+ PlayerData playerData = mock(PlayerData.class);
BukkitTask existingMessageTask = mock(BukkitTask.class);
- given(limboPlayer.getMessageTask()).willReturn(existingMessageTask);
+ given(playerData.getMessageTask()).willReturn(existingMessageTask);
String name = "bobby";
- given(limboCache.getLimboPlayer(name)).willReturn(limboPlayer);
+ given(limboCache.getPlayerData(name)).willReturn(playerData);
given(messages.retrieve(MessageKey.REGISTER_EMAIL_MESSAGE))
.willReturn(new String[]{"Please register", "Use /register"});
@@ -128,10 +128,10 @@ public class LimboPlayerTaskManagerTest {
given(settings.getProperty(RegistrationSettings.USE_EMAIL_REGISTRATION)).willReturn(true);
// when
- limboPlayerTaskManager.registerMessageTask(name, false);
+ playerDataTaskManager.registerMessageTask(name, false);
// then
- verify(limboPlayer).setMessageTask(bukkiTask);
+ verify(playerData).setMessageTask(bukkiTask);
verify(messages).retrieve(MessageKey.REGISTER_EMAIL_MESSAGE);
verify(existingMessageTask).cancel();
}
@@ -142,17 +142,17 @@ public class LimboPlayerTaskManagerTest {
String name = "l33tPlayer";
Player player = mock(Player.class);
given(player.getName()).willReturn(name);
- LimboPlayer limboPlayer = mock(LimboPlayer.class);
- given(limboCache.getLimboPlayer(name)).willReturn(limboPlayer);
+ PlayerData playerData = mock(PlayerData.class);
+ given(limboCache.getPlayerData(name)).willReturn(playerData);
given(settings.getProperty(RestrictionSettings.TIMEOUT)).willReturn(30);
BukkitTask bukkitTask = mock(BukkitTask.class);
given(bukkitService.runTaskLater(any(TimeoutTask.class), anyLong())).willReturn(bukkitTask);
// when
- limboPlayerTaskManager.registerTimeoutTask(player);
+ playerDataTaskManager.registerTimeoutTask(player);
// then
- verify(limboPlayer).setTimeoutTask(bukkitTask);
+ verify(playerData).setTimeoutTask(bukkitTask);
verify(bukkitService).runTaskLater(any(TimeoutTask.class), eq(600L)); // 30 * TICKS_PER_SECOND
verify(messages).retrieveSingle(MessageKey.LOGIN_TIMEOUT_ERROR);
}
@@ -163,11 +163,11 @@ public class LimboPlayerTaskManagerTest {
String name = "Phantom_";
Player player = mock(Player.class);
given(player.getName()).willReturn(name);
- given(limboCache.getLimboPlayer(name)).willReturn(null);
+ given(limboCache.getPlayerData(name)).willReturn(null);
given(settings.getProperty(RestrictionSettings.TIMEOUT)).willReturn(27);
// when
- limboPlayerTaskManager.registerTimeoutTask(player);
+ playerDataTaskManager.registerTimeoutTask(player);
// then
verifyZeroInteractions(bukkitService, messages);
@@ -179,15 +179,15 @@ public class LimboPlayerTaskManagerTest {
String name = "snail";
Player player = mock(Player.class);
given(player.getName()).willReturn(name);
- LimboPlayer limboPlayer = mock(LimboPlayer.class);
- given(limboCache.getLimboPlayer(name)).willReturn(limboPlayer);
+ PlayerData playerData = mock(PlayerData.class);
+ given(limboCache.getPlayerData(name)).willReturn(playerData);
given(settings.getProperty(RestrictionSettings.TIMEOUT)).willReturn(0);
// when
- limboPlayerTaskManager.registerTimeoutTask(player);
+ playerDataTaskManager.registerTimeoutTask(player);
// then
- verifyZeroInteractions(limboPlayer, bukkitService);
+ verifyZeroInteractions(playerData, bukkitService);
}
@Test
@@ -196,20 +196,20 @@ public class LimboPlayerTaskManagerTest {
String name = "l33tPlayer";
Player player = mock(Player.class);
given(player.getName()).willReturn(name);
- LimboPlayer limboPlayer = mock(LimboPlayer.class);
+ PlayerData playerData = mock(PlayerData.class);
BukkitTask existingTask = mock(BukkitTask.class);
- given(limboPlayer.getTimeoutTask()).willReturn(existingTask);
- given(limboCache.getLimboPlayer(name)).willReturn(limboPlayer);
+ given(playerData.getTimeoutTask()).willReturn(existingTask);
+ given(limboCache.getPlayerData(name)).willReturn(playerData);
given(settings.getProperty(RestrictionSettings.TIMEOUT)).willReturn(18);
BukkitTask bukkitTask = mock(BukkitTask.class);
given(bukkitService.runTaskLater(any(TimeoutTask.class), anyLong())).willReturn(bukkitTask);
// when
- limboPlayerTaskManager.registerTimeoutTask(player);
+ playerDataTaskManager.registerTimeoutTask(player);
// then
verify(existingTask).cancel();
- verify(limboPlayer).setTimeoutTask(bukkitTask);
+ verify(playerData).setTimeoutTask(bukkitTask);
verify(bukkitService).runTaskLater(any(TimeoutTask.class), eq(360L)); // 18 * TICKS_PER_SECOND
verify(messages).retrieveSingle(MessageKey.LOGIN_TIMEOUT_ERROR);
}
diff --git a/src/test/java/fr/xephi/authme/task/PurgeServiceTest.java b/src/test/java/fr/xephi/authme/task/PurgeServiceTest.java
index 3eb4bac4..a631476e 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
diff --git a/src/test/java/fr/xephi/authme/util/TeleportationServiceTest.java b/src/test/java/fr/xephi/authme/util/TeleportationServiceTest.java
index ad9d9620..dba15782 100644
--- a/src/test/java/fr/xephi/authme/util/TeleportationServiceTest.java
+++ b/src/test/java/fr/xephi/authme/util/TeleportationServiceTest.java
@@ -2,7 +2,7 @@ package fr.xephi.authme.util;
import fr.xephi.authme.cache.auth.PlayerAuth;
import fr.xephi.authme.cache.auth.PlayerCache;
-import fr.xephi.authme.cache.limbo.LimboPlayer;
+import fr.xephi.authme.cache.limbo.PlayerData;
import fr.xephi.authme.events.FirstSpawnTeleportEvent;
import fr.xephi.authme.events.SpawnTeleportEvent;
import fr.xephi.authme.settings.NewSetting;
@@ -92,7 +92,7 @@ public class TeleportationServiceTest {
given(spawnLoader.getFirstSpawn()).willReturn(firstSpawn);
// when
- teleportationService.teleportOnJoin(player);
+ teleportationService.teleportNewPlayerToFirstSpawn(player);
runSyncDelayedTask(bukkitService);
// then
@@ -107,7 +107,6 @@ public class TeleportationServiceTest {
// given
given(settings.getProperty(RestrictionSettings.TELEPORT_UNAUTHED_TO_SPAWN)).willReturn(true);
Player player = mock(Player.class);
- given(player.hasPlayedBefore()).willReturn(true);
given(player.isOnline()).willReturn(true);
Location spawn = mockLocation();
given(spawnLoader.getSpawnLocation(player)).willReturn(spawn);
@@ -135,7 +134,7 @@ public class TeleportationServiceTest {
given(spawnLoader.getFirstSpawn()).willReturn(null);
// when
- teleportationService.teleportOnJoin(player);
+ teleportationService.teleportNewPlayerToFirstSpawn(player);
// then
verify(player, never()).teleport(any(Location.class));
@@ -145,10 +144,39 @@ public class TeleportationServiceTest {
}
@Test
- public void shouldTeleportPlayerDueToForcedWorld() {
+ public void shouldNotTeleportPlayerToFirstSpawnIfNoTeleportEnabled() {
+ // given
+ Player player = mock(Player.class);
+ given(player.hasPlayedBefore()).willReturn(false);
+ given(settings.getProperty(RestrictionSettings.NO_TELEPORT)).willReturn(true);
+
+ // when
+ teleportationService.teleportNewPlayerToFirstSpawn(player);
+
+ // then
+ verify(player, never()).teleport(any(Location.class));
+ verifyZeroInteractions(bukkitService);
+ }
+
+ @Test
+ public void shouldNotTeleportNotNewPlayerToFirstSpawn() {
// given
Player player = mock(Player.class);
given(player.hasPlayedBefore()).willReturn(true);
+ given(settings.getProperty(RestrictionSettings.NO_TELEPORT)).willReturn(false);
+
+ // when
+ teleportationService.teleportNewPlayerToFirstSpawn(player);
+
+ // then
+ verify(player, never()).teleport(any(Location.class));
+ verifyZeroInteractions(bukkitService);
+ }
+
+ @Test
+ public void shouldTeleportPlayerDueToForcedWorld() {
+ // given
+ Player player = mock(Player.class);
given(player.isOnline()).willReturn(true);
World playerWorld = mock(World.class);
@@ -174,7 +202,6 @@ public class TeleportationServiceTest {
public void shouldNotTeleportPlayerForRemovedLocationInEvent() {
// given
final Player player = mock(Player.class);
- given(player.hasPlayedBefore()).willReturn(true);
Location spawn = mockLocation();
given(spawnLoader.getSpawnLocation(player)).willReturn(spawn);
given(settings.getProperty(RestrictionSettings.TELEPORT_UNAUTHED_TO_SPAWN)).willReturn(true);
@@ -201,7 +228,6 @@ public class TeleportationServiceTest {
public void shouldNotTeleportPlayerForCanceledEvent() {
// given
final Player player = mock(Player.class);
- given(player.hasPlayedBefore()).willReturn(true);
Location spawn = mockLocation();
given(spawnLoader.getSpawnLocation(player)).willReturn(spawn);
given(settings.getProperty(RestrictionSettings.TELEPORT_UNAUTHED_TO_SPAWN)).willReturn(true);
@@ -224,7 +250,6 @@ public class TeleportationServiceTest {
verify(player, never()).teleport(any(Location.class));
}
-
// ---------
// LOGIN
// ---------
@@ -234,7 +259,7 @@ public class TeleportationServiceTest {
given(settings.getProperty(RestrictionSettings.NO_TELEPORT)).willReturn(true);
Player player = mock(Player.class);
PlayerAuth auth = mock(PlayerAuth.class);
- LimboPlayer limbo = mock(LimboPlayer.class);
+ PlayerData limbo = mock(PlayerData.class);
// when
teleportationService.teleportOnLogin(player, auth, limbo);
@@ -252,10 +277,10 @@ public class TeleportationServiceTest {
Location spawn = mockLocation();
given(spawnLoader.getSpawnLocation(player)).willReturn(spawn);
PlayerAuth auth = mock(PlayerAuth.class);
- LimboPlayer limbo = mock(LimboPlayer.class);
+ PlayerData limbo = mock(PlayerData.class);
Location limboLocation = mockLocation();
given(limboLocation.getWorld().getName()).willReturn("forced1");
- given(limbo.getLoc()).willReturn(limboLocation);
+ given(limbo.getLocation()).willReturn(limboLocation);
// when
teleportationService.teleportOnLogin(player, auth, limbo);
@@ -276,10 +301,10 @@ public class TeleportationServiceTest {
Location spawn = mockLocation();
given(spawnLoader.getSpawnLocation(player)).willReturn(spawn);
PlayerAuth auth = mock(PlayerAuth.class);
- LimboPlayer limbo = mock(LimboPlayer.class);
+ PlayerData limbo = mock(PlayerData.class);
Location limboLocation = mockLocation();
given(limboLocation.getWorld().getName()).willReturn("Forced1"); // different case
- given(limbo.getLoc()).willReturn(limboLocation);
+ given(limbo.getLocation()).willReturn(limboLocation);
// when
teleportationService.teleportOnLogin(player, auth, limbo);
@@ -303,9 +328,9 @@ public class TeleportationServiceTest {
Player player = mock(Player.class);
given(player.isOnline()).willReturn(true);
- LimboPlayer limbo = mock(LimboPlayer.class);
+ PlayerData limbo = mock(PlayerData.class);
Location limboLocation = mockLocation();
- given(limbo.getLoc()).willReturn(limboLocation);
+ given(limbo.getLocation()).willReturn(limboLocation);
// when
teleportationService.teleportOnLogin(player, auth, limbo);
@@ -332,9 +357,9 @@ public class TeleportationServiceTest {
given(player.isOnline()).willReturn(true);
World world = mock(World.class);
given(player.getWorld()).willReturn(world);
- LimboPlayer limbo = mock(LimboPlayer.class);
+ PlayerData limbo = mock(PlayerData.class);
Location limboLocation = mockLocation();
- given(limbo.getLoc()).willReturn(limboLocation);
+ given(limbo.getLocation()).willReturn(limboLocation);
// when
teleportationService.teleportOnLogin(player, auth, limbo);
@@ -360,9 +385,9 @@ public class TeleportationServiceTest {
given(player.isOnline()).willReturn(true);
World world = mock(World.class);
given(player.getWorld()).willReturn(world);
- LimboPlayer limbo = mock(LimboPlayer.class);
+ PlayerData limbo = mock(PlayerData.class);
Location location = mockLocation();
- given(limbo.getLoc()).willReturn(location);
+ given(limbo.getLocation()).willReturn(location);
// when
teleportationService.teleportOnLogin(player, auth, limbo);
@@ -385,9 +410,9 @@ public class TeleportationServiceTest {
given(player.isOnline()).willReturn(true);
World world = mock(World.class);
given(player.getWorld()).willReturn(world);
- LimboPlayer limbo = mock(LimboPlayer.class);
+ PlayerData limbo = mock(PlayerData.class);
Location location = mockLocation();
- given(limbo.getLoc()).willReturn(location);
+ given(limbo.getLocation()).willReturn(location);
// when
teleportationService.teleportOnLogin(player, auth, limbo);
@@ -397,6 +422,12 @@ public class TeleportationServiceTest {
verify(player).teleport(location);
}
+ private static void assertCorrectLocation(Location location, PlayerAuth auth, World world) {
+ assertThat(location.getX(), equalTo(auth.getQuitLocX()));
+ assertThat(location.getY(), equalTo(auth.getQuitLocY()));
+ assertThat(location.getZ(), equalTo(auth.getQuitLocZ()));
+ assertThat(location.getWorld(), equalTo(world));
+ }
// We check that the World in Location is set, this method creates a mock World in Location for us
private static Location mockLocation() {
@@ -412,11 +443,4 @@ public class TeleportationServiceTest {
.build();
}
- private void assertCorrectLocation(Location location, PlayerAuth auth, World world) {
- assertThat(location.getX(), equalTo(auth.getQuitLocX()));
- assertThat(location.getY(), equalTo(auth.getQuitLocY()));
- assertThat(location.getZ(), equalTo(auth.getQuitLocZ()));
- assertThat(location.getWorld(), equalTo(world));
- }
-
}
diff --git a/src/test/java/fr/xephi/authme/util/UtilsTest.java b/src/test/java/fr/xephi/authme/util/UtilsTest.java
index 58af9b7c..b57300fd 100644
--- a/src/test/java/fr/xephi/authme/util/UtilsTest.java
+++ b/src/test/java/fr/xephi/authme/util/UtilsTest.java
@@ -90,4 +90,10 @@ public class UtilsTest {
// then
assertThat(result, equalTo(name));
}
+
+ @Test
+ public void shouldHavePrivateConstructorOnly() {
+ // given / when / then
+ TestHelper.validateHasOnlyPrivateEmptyConstructor(Utils.class);
+ }
}
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 afaaf9f2..00000000
--- 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 79d3b504..00000000
Binary files a/src/test/java/tools/dependencygraph/graph_stripped1time_20160612.png and /dev/null differ