mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-20 07:37:47 +01:00
Code householding - remove legacy settings and TODO messages
- Remove fields in legacy settings that are now unused - Remove various irrelevant todo messages - Reduce visibility on some elements
This commit is contained in:
parent
e54cd526de
commit
6341d00df0
@ -120,7 +120,6 @@ public class HelpProvider implements SettingsDependent {
|
||||
}
|
||||
|
||||
private static void printAlternatives(CommandDescription command, List<String> correctLabels, List<String> lines) {
|
||||
// TODO ljacqu 20151219: Need to show alternatives for base labels too? E.g. /r for /register
|
||||
if (command.getLabels().size() <= 1 || correctLabels.size() <= 1) {
|
||||
return;
|
||||
}
|
||||
|
@ -52,7 +52,6 @@ public class ProcessSyncPlayerLogin implements SynchronousProcess {
|
||||
private BukkitService bukkitService;
|
||||
|
||||
@Inject
|
||||
// TODO ljacqu 20160520: Need to check whether we want to inject PluginManager, or some intermediate service
|
||||
private PluginManager pluginManager;
|
||||
|
||||
private final boolean restoreCollisions = MethodUtils
|
||||
|
@ -37,7 +37,7 @@ public class ProcessSyncEmailRegister implements SynchronousProcess {
|
||||
@Inject
|
||||
private AuthMe authMe;
|
||||
|
||||
public ProcessSyncEmailRegister() { }
|
||||
ProcessSyncEmailRegister() { }
|
||||
|
||||
public void processEmailRegister(Player player) {
|
||||
final String name = player.getName().toLowerCase();
|
||||
|
@ -151,7 +151,7 @@ public class PasswordSecurity implements Reloadable {
|
||||
*
|
||||
* @return The associated encryption method, or null if CUSTOM / deprecated
|
||||
*/
|
||||
public EncryptionMethod initializeEncryptionMethod(HashAlgorithm algorithm) {
|
||||
private EncryptionMethod initializeEncryptionMethod(HashAlgorithm algorithm) {
|
||||
if (HashAlgorithm.CUSTOM.equals(algorithm) || HashAlgorithm.PLAINTEXT.equals(algorithm)) {
|
||||
return null;
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package fr.xephi.authme.settings;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.security.HashAlgorithm;
|
||||
import fr.xephi.authme.settings.domain.Property;
|
||||
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||
import fr.xephi.authme.settings.properties.PluginSettings;
|
||||
@ -11,37 +10,45 @@ import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Old settings manager. See {@link NewSetting} for the new manager.
|
||||
*/
|
||||
public final class Settings {
|
||||
|
||||
public static List<String> allowCommands;
|
||||
public static List<String> getUnrestrictedName;
|
||||
public static List<String> getForcedWorlds;
|
||||
public static List<String> countries;
|
||||
public static List<String> countriesBlacklist;
|
||||
public static HashAlgorithm getPasswordHash;
|
||||
public static Pattern nickPattern;
|
||||
public static boolean isPermissionCheckEnabled,
|
||||
isForcedRegistrationEnabled, isTeleportToSpawnEnabled,
|
||||
isSessionsEnabled, isAllowRestrictedIp,
|
||||
isForceSingleSessionEnabled, isForceSpawnLocOnJoinEnabled,
|
||||
isSaveQuitLocationEnabled, protectInventoryBeforeLogInEnabled,
|
||||
isStopEnabled, reloadSupport, rakamakUseIp,
|
||||
removePassword, multiverse, bungee,
|
||||
enableProtection, forceRegLogin, noTeleport,
|
||||
allowAllCommandsIfRegIsOptional, isRemoveSpeedEnabled;
|
||||
public static String getNickRegex, getUnloggedinGroup,
|
||||
unRegisteredGroup, backupWindowsPath, getRegisteredGroup,
|
||||
rakamakUsers, rakamakUsersIp, defaultWorld, crazyloginFileName;
|
||||
public static int getSessionTimeout, getMaxNickLength, getMinNickLength,
|
||||
getNonActivatedGroup, maxLoginTry, captchaLength, getMaxLoginPerIp;
|
||||
protected static FileConfiguration configFile;
|
||||
public static boolean isPermissionCheckEnabled;
|
||||
public static boolean isForcedRegistrationEnabled;
|
||||
public static boolean isTeleportToSpawnEnabled;
|
||||
public static boolean isSessionsEnabled;
|
||||
public static boolean isAllowRestrictedIp;
|
||||
public static boolean isForceSpawnLocOnJoinEnabled;
|
||||
public static boolean isSaveQuitLocationEnabled;
|
||||
public static boolean protectInventoryBeforeLogInEnabled;
|
||||
public static boolean isStopEnabled;
|
||||
public static boolean reloadSupport;
|
||||
public static boolean rakamakUseIp;
|
||||
public static boolean removePassword;
|
||||
public static boolean multiverse;
|
||||
public static boolean bungee;
|
||||
public static boolean forceRegLogin;
|
||||
public static boolean noTeleport;
|
||||
public static boolean isRemoveSpeedEnabled;
|
||||
public static String getUnloggedinGroup;
|
||||
public static String unRegisteredGroup;
|
||||
public static String getRegisteredGroup;
|
||||
public static String rakamakUsers;
|
||||
public static String rakamakUsersIp;
|
||||
public static String defaultWorld;
|
||||
public static String crazyloginFileName;
|
||||
public static int getSessionTimeout;
|
||||
public static int getNonActivatedGroup;
|
||||
public static int maxLoginTry;
|
||||
public static int captchaLength;
|
||||
public static int getMaxLoginPerIp;
|
||||
private static FileConfiguration configFile;
|
||||
|
||||
/**
|
||||
* Constructor for Settings.
|
||||
@ -59,16 +66,10 @@ public final class Settings {
|
||||
isTeleportToSpawnEnabled = load(RestrictionSettings.TELEPORT_UNAUTHED_TO_SPAWN);
|
||||
isSessionsEnabled = load(PluginSettings.SESSIONS_ENABLED);
|
||||
getSessionTimeout = configFile.getInt("settings.sessions.timeout", 10);
|
||||
getMaxNickLength = configFile.getInt("settings.restrictions.maxNicknameLength", 20);
|
||||
getMinNickLength = configFile.getInt("settings.restrictions.minNicknameLength", 3);
|
||||
getNickRegex = load(RestrictionSettings.ALLOWED_NICKNAME_CHARACTERS);
|
||||
nickPattern = Pattern.compile(getNickRegex);
|
||||
isAllowRestrictedIp = load(RestrictionSettings.ENABLE_RESTRICTED_USERS);
|
||||
isRemoveSpeedEnabled = load(RestrictionSettings.REMOVE_SPEED);
|
||||
isForceSingleSessionEnabled = load(RestrictionSettings.FORCE_SINGLE_SESSION);
|
||||
isForceSpawnLocOnJoinEnabled = load(RestrictionSettings.FORCE_SPAWN_LOCATION_AFTER_LOGIN);
|
||||
isSaveQuitLocationEnabled = configFile.getBoolean("settings.restrictions.SaveQuitLocation", false);
|
||||
getPasswordHash = load(SecuritySettings.PASSWORD_HASH);
|
||||
getUnloggedinGroup = load(SecuritySettings.UNLOGGEDIN_GROUP);
|
||||
getNonActivatedGroup = configFile.getInt("ExternalBoardOptions.nonActivedUserGroup", -1);
|
||||
unRegisteredGroup = configFile.getString("GroupOptions.UnregisteredPlayerGroup", "");
|
||||
@ -80,20 +81,9 @@ public final class Settings {
|
||||
|
||||
getRegisteredGroup = configFile.getString("GroupOptions.RegisteredPlayerGroup", "");
|
||||
protectInventoryBeforeLogInEnabled = load(RestrictionSettings.PROTECT_INVENTORY_BEFORE_LOGIN);
|
||||
backupWindowsPath = configFile.getString("BackupSystem.MysqlWindowsPath", "C:\\Program Files\\MySQL\\MySQL Server 5.1\\");
|
||||
isStopEnabled = configFile.getBoolean("Security.SQLProblem.stopServer", true);
|
||||
reloadSupport = configFile.getBoolean("Security.ReloadCommand.useReloadCommandSupport", true);
|
||||
|
||||
allowAllCommandsIfRegIsOptional = load(RestrictionSettings.ALLOW_ALL_COMMANDS_IF_REGISTRATION_IS_OPTIONAL);
|
||||
allowCommands = new ArrayList<>();
|
||||
allowCommands.addAll(Arrays.asList("/login", "/l", "/register", "/reg", "/email", "/captcha"));
|
||||
for (String cmd : configFile.getStringList("settings.restrictions.allowCommands")) {
|
||||
cmd = cmd.toLowerCase();
|
||||
if (!allowCommands.contains(cmd)) {
|
||||
allowCommands.add(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
rakamakUsers = configFile.getString("Converter.Rakamak.fileName", "users.rak");
|
||||
rakamakUsersIp = configFile.getString("Converter.Rakamak.ipFileName", "UsersIp.rak");
|
||||
rakamakUseIp = configFile.getBoolean("Converter.Rakamak.useIp", false);
|
||||
@ -104,9 +94,6 @@ public final class Settings {
|
||||
bungee = load(HooksSettings.BUNGEECORD);
|
||||
getForcedWorlds = load(RestrictionSettings.FORCE_SPAWN_ON_WORLDS);
|
||||
defaultWorld = configFile.getString("Purge.defaultWorld", "world");
|
||||
enableProtection = configFile.getBoolean("Protection.enableProtection", false);
|
||||
countries = configFile.getStringList("Protection.countries");
|
||||
countriesBlacklist = configFile.getStringList("Protection.countriesBlacklist");
|
||||
forceRegLogin = load(RegistrationSettings.FORCE_LOGIN_AFTER_REGISTER);
|
||||
getMaxLoginPerIp = load(RestrictionSettings.MAX_LOGIN_PER_IP);
|
||||
noTeleport = load(RestrictionSettings.NO_TELEPORT);
|
||||
|
@ -201,7 +201,6 @@ public class SpawnLoader implements SettingsDependent {
|
||||
}
|
||||
|
||||
private boolean saveAuthMeConfig() {
|
||||
// TODO ljacqu 20160312: Investigate whether this utility should be put in a Utils class
|
||||
try {
|
||||
authMeConfiguration.save(authMeConfigurationFile);
|
||||
return true;
|
||||
|
Loading…
Reference in New Issue
Block a user