Cleanup - remove unused elements in code

This commit is contained in:
ljacqu
2016-07-04 21:51:12 +02:00
parent ea6603a6dc
commit d8f6fb085e
8 changed files with 6 additions and 110 deletions
@@ -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));
}
}
@@ -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() {
}
@@ -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);
}
@@ -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() {
}