Cleanup - remove unused elements in code
This commit is contained in:
parent
ea6603a6dc
commit
d8f6fb085e
@ -592,12 +592,6 @@ public class AuthMe extends JavaPlugin {
|
|||||||
return pluginHooks != null && pluginHooks.isNpc(player) || player.hasMetadata("NPC");
|
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() {
|
private void scheduleRecallEmailTask() {
|
||||||
if (!newSettings.getProperty(RECALL_PLAYERS)) {
|
if (!newSettings.getProperty(RECALL_PLAYERS)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -73,20 +73,6 @@ public class AsynchronousLogin implements AsynchronousProcess {
|
|||||||
|
|
||||||
AsynchronousLogin() { }
|
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
|
* Checks the precondition for authentication (like user known) and returns
|
||||||
* the playerAuth-State
|
* the playerAuth-State
|
||||||
@ -141,7 +127,7 @@ public class AsynchronousLogin implements AsynchronousProcess {
|
|||||||
final String name = player.getName().toLowerCase();
|
final String name = player.getName().toLowerCase();
|
||||||
|
|
||||||
// If Captcha is required send a message to the player and deny to login
|
// 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));
|
service.send(player, MessageKey.USAGE_CAPTCHA, captchaManager.getCaptchaCodeOrGenerateNew(name));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -218,7 +204,7 @@ public class AsynchronousLogin implements AsynchronousProcess {
|
|||||||
service.send(player, MessageKey.WRONG_PASSWORD);
|
service.send(player, MessageKey.WRONG_PASSWORD);
|
||||||
|
|
||||||
// If the authentication fails check if Captcha is required and send a message to the player
|
// 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));
|
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 com.google.common.io.ByteStreams;
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||||
import fr.xephi.authme.datasource.DataSource;
|
|
||||||
import fr.xephi.authme.events.LoginEvent;
|
import fr.xephi.authme.events.LoginEvent;
|
||||||
import fr.xephi.authme.events.RestoreInventoryEvent;
|
import fr.xephi.authme.events.RestoreInventoryEvent;
|
||||||
import fr.xephi.authme.listener.AuthMePlayerListener;
|
import fr.xephi.authme.listener.AuthMePlayerListener;
|
||||||
import fr.xephi.authme.listener.protocollib.ProtocolLibService;
|
|
||||||
import fr.xephi.authme.process.ProcessService;
|
import fr.xephi.authme.process.ProcessService;
|
||||||
import fr.xephi.authme.process.SynchronousProcess;
|
import fr.xephi.authme.process.SynchronousProcess;
|
||||||
import fr.xephi.authme.settings.properties.HooksSettings;
|
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||||
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
import fr.xephi.authme.settings.properties.RegistrationSettings;
|
||||||
import fr.xephi.authme.util.BukkitService;
|
import fr.xephi.authme.util.BukkitService;
|
||||||
import fr.xephi.authme.util.TeleportationService;
|
|
||||||
import org.apache.commons.lang.reflect.MethodUtils;
|
import org.apache.commons.lang.reflect.MethodUtils;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
@ -41,21 +38,12 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess {
|
|||||||
@Inject
|
@Inject
|
||||||
private LimboCache limboCache;
|
private LimboCache limboCache;
|
||||||
|
|
||||||
@Inject
|
|
||||||
private DataSource dataSource;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private BukkitService bukkitService;
|
private BukkitService bukkitService;
|
||||||
|
|
||||||
@Inject
|
|
||||||
private ProtocolLibService protocolLibService;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private PluginManager pluginManager;
|
private PluginManager pluginManager;
|
||||||
|
|
||||||
@Inject
|
|
||||||
private TeleportationService teleportationService;
|
|
||||||
|
|
||||||
ProcessSyncPlayerLogin() {
|
ProcessSyncPlayerLogin() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -52,7 +52,6 @@ public class AsynchronousLogout implements AsynchronousProcess {
|
|||||||
|
|
||||||
limboCache.addPlayerData(player);
|
limboCache.addPlayerData(player);
|
||||||
playerCache.removePlayer(name);
|
playerCache.removePlayer(name);
|
||||||
// TODO LJ: No more teleport here?
|
|
||||||
database.setUnlogged(name);
|
database.setUnlogged(name);
|
||||||
syncProcessManager.processSyncPlayerLogout(player);
|
syncProcessManager.processSyncPlayerLogout(player);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import fr.xephi.authme.ConsoleLogger;
|
|||||||
import fr.xephi.authme.cache.limbo.LimboCache;
|
import fr.xephi.authme.cache.limbo.LimboCache;
|
||||||
import fr.xephi.authme.events.LoginEvent;
|
import fr.xephi.authme.events.LoginEvent;
|
||||||
import fr.xephi.authme.events.RestoreInventoryEvent;
|
import fr.xephi.authme.events.RestoreInventoryEvent;
|
||||||
import fr.xephi.authme.listener.protocollib.ProtocolLibService;
|
|
||||||
import fr.xephi.authme.output.MessageKey;
|
import fr.xephi.authme.output.MessageKey;
|
||||||
import fr.xephi.authme.permission.AuthGroupType;
|
import fr.xephi.authme.permission.AuthGroupType;
|
||||||
import fr.xephi.authme.process.ProcessService;
|
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.settings.properties.SecuritySettings;
|
||||||
import fr.xephi.authme.task.PlayerDataTaskManager;
|
import fr.xephi.authme.task.PlayerDataTaskManager;
|
||||||
import fr.xephi.authme.util.BukkitService;
|
import fr.xephi.authme.util.BukkitService;
|
||||||
import fr.xephi.authme.util.TeleportationService;
|
|
||||||
import fr.xephi.authme.util.Utils;
|
import fr.xephi.authme.util.Utils;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -35,18 +33,18 @@ public class ProcessSyncPasswordRegister implements SynchronousProcess {
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private AuthMe plugin;
|
private AuthMe plugin;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ProcessService service;
|
private ProcessService service;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private BukkitService bukkitService;
|
private BukkitService bukkitService;
|
||||||
@Inject
|
|
||||||
private ProtocolLibService protocolLibService;
|
|
||||||
@Inject
|
@Inject
|
||||||
private LimboCache limboCache;
|
private LimboCache limboCache;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private PlayerDataTaskManager playerDataTaskManager;
|
private PlayerDataTaskManager playerDataTaskManager;
|
||||||
@Inject
|
|
||||||
private TeleportationService teleportationService;
|
|
||||||
|
|
||||||
ProcessSyncPasswordRegister() {
|
ProcessSyncPasswordRegister() {
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package fr.xephi.authme.settings;
|
|||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.settings.domain.Property;
|
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.RestrictionSettings;
|
||||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
@ -16,16 +15,12 @@ import java.util.List;
|
|||||||
public final class Settings {
|
public final class Settings {
|
||||||
|
|
||||||
public static List<String> getUnrestrictedName;
|
public static List<String> getUnrestrictedName;
|
||||||
public static boolean isPermissionCheckEnabled;
|
|
||||||
public static boolean isTeleportToSpawnEnabled;
|
|
||||||
public static boolean isAllowRestrictedIp;
|
public static boolean isAllowRestrictedIp;
|
||||||
public static boolean isStopEnabled;
|
public static boolean isStopEnabled;
|
||||||
public static boolean reloadSupport;
|
public static boolean reloadSupport;
|
||||||
public static boolean noTeleport;
|
|
||||||
public static String getUnloggedinGroup;
|
public static String getUnloggedinGroup;
|
||||||
public static String unRegisteredGroup;
|
public static String unRegisteredGroup;
|
||||||
public static String getRegisteredGroup;
|
public static String getRegisteredGroup;
|
||||||
public static String defaultWorld;
|
|
||||||
public static int getNonActivatedGroup;
|
public static int getNonActivatedGroup;
|
||||||
private static FileConfiguration configFile;
|
private static FileConfiguration configFile;
|
||||||
|
|
||||||
@ -40,8 +35,6 @@ public final class Settings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void loadVariables() {
|
private static void loadVariables() {
|
||||||
isPermissionCheckEnabled = load(PluginSettings.ENABLE_PERMISSION_CHECK);
|
|
||||||
isTeleportToSpawnEnabled = load(RestrictionSettings.TELEPORT_UNAUTHED_TO_SPAWN);
|
|
||||||
isAllowRestrictedIp = load(RestrictionSettings.ENABLE_RESTRICTED_USERS);
|
isAllowRestrictedIp = load(RestrictionSettings.ENABLE_RESTRICTED_USERS);
|
||||||
getUnloggedinGroup = load(SecuritySettings.UNLOGGEDIN_GROUP);
|
getUnloggedinGroup = load(SecuritySettings.UNLOGGEDIN_GROUP);
|
||||||
getNonActivatedGroup = configFile.getInt("ExternalBoardOptions.nonActivedUserGroup", -1);
|
getNonActivatedGroup = configFile.getInt("ExternalBoardOptions.nonActivedUserGroup", -1);
|
||||||
@ -50,8 +43,6 @@ public final class Settings {
|
|||||||
getRegisteredGroup = configFile.getString("GroupOptions.RegisteredPlayerGroup", "");
|
getRegisteredGroup = configFile.getString("GroupOptions.RegisteredPlayerGroup", "");
|
||||||
isStopEnabled = configFile.getBoolean("Security.SQLProblem.stopServer", true);
|
isStopEnabled = configFile.getBoolean("Security.SQLProblem.stopServer", true);
|
||||||
reloadSupport = configFile.getBoolean("Security.ReloadCommand.useReloadCommandSupport", true);
|
reloadSupport = configFile.getBoolean("Security.ReloadCommand.useReloadCommandSupport", true);
|
||||||
defaultWorld = configFile.getString("Purge.defaultWorld", "world");
|
|
||||||
noTeleport = load(RestrictionSettings.NO_TELEPORT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -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";
|
|
||||||
}
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 266 KiB |
Loading…
x
Reference in New Issue
Block a user