From 75750f8417f51270cf995c040c624d944be5305e Mon Sep 17 00:00:00 2001 From: Smart123s <28480228+Smart123s@users.noreply.github.com> Date: Sat, 8 May 2021 14:20:56 +0200 Subject: [PATCH] Apostrophes are no longer necessary in config.yml --- .../games647/fastlogin/bukkit/FastLoginBukkit.java | 4 ++-- .../bukkit/listener/protocollib/NameCheckTask.java | 2 +- .../fastlogin/bukkit/task/FloodgateAuthTask.java | 10 +++++----- core/src/main/resources/config.yml | 6 ++---- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java index 1aa964b7..8ab87493 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/FastLoginBukkit.java @@ -229,8 +229,8 @@ public class FastLoginBukkit extends JavaPlugin implements PlatformPlugintrue if the entry's value is "true", "false", or "linked" */ private boolean isValidFloodgateConfigString(String key) { - String value = core.getConfig().getString(key); - if (!value.equalsIgnoreCase("true") && !value.equalsIgnoreCase("linked") && !value.equalsIgnoreCase("false")) { + String value = core.getConfig().get(key).toString().toLowerCase(); + if (!value.equals("true") && !value.equals("linked") && !value.equals("false")) { logger.error("Invalid value detected for {} in FastLogin/config.yml.", key); return false; } diff --git a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/NameCheckTask.java b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/NameCheckTask.java index e2b04a76..8e66d150 100644 --- a/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/NameCheckTask.java +++ b/bukkit/src/main/java/com/github/games647/fastlogin/bukkit/listener/protocollib/NameCheckTask.java @@ -46,7 +46,7 @@ public class NameCheckTask extends JoinManagement authPlugin = plugin.getCore().getAuthPluginHook(); - String autoLoginFloodgate = plugin.getCore().getConfig().getString("autoLoginFloodgate"); + String autoLoginFloodgate = plugin.getCore().getConfig().get("autoLoginFloodgate").toString().toLowerCase(); boolean autoRegisterFloodgate = plugin.getCore().getConfig().getBoolean("autoRegisterFloodgate"); boolean isRegistered; @@ -75,8 +75,8 @@ public class FloodgateAuthTask implements Runnable { BukkitLoginSession session = new BukkitLoginSession(player.getName(), isRegistered, profile); // enable auto login based on the value of 'autoLoginFloodgate' in config.yml - session.setVerified(autoLoginFloodgate.equalsIgnoreCase("true") - || (autoLoginFloodgate.equalsIgnoreCase("linked") && isLinked)); + session.setVerified(autoLoginFloodgate.equals("true") + || (autoLoginFloodgate.equals("linked") && isLinked)); // run login task Runnable forceLoginTask = new ForceLoginTask(plugin.getCore(), player, session); diff --git a/core/src/main/resources/config.yml b/core/src/main/resources/config.yml index 48412665..5b4667d1 100644 --- a/core/src/main/resources/config.yml +++ b/core/src/main/resources/config.yml @@ -196,10 +196,9 @@ autoLogin: true # This enables auto login for every player connecting through Floodgate. # Possible values: false, true, linked # Linked means that only Bedrock accounts linked to a Java account will be logged in automatically -# !!! DO NOT REMOVE THE APOSTROPHE !!! # !!!!!!!! WARNING: FLOODGATE SUPPORT IS AN EXPERIMENTAL FEATURE !!!!!!!! # Enabling this might lead to people gaining unauthorized access to other's accounts! -autoLoginFloodgate: 'false' +autoLoginFloodgate: false # This enables Floodgate players to join the server, even if autoRegister is true and there's an existing # Java **PREMIUM** account with the same name @@ -219,10 +218,9 @@ autoLoginFloodgate: 'false' # 'autoRegister' must be 'true' for this to work # true: Bypass 'autoRegister's name conflict checking # linked: Bedrock accounts linked to a Java account will be allowed to join with conflicting names -# !!! DO NOT REMOVE THE APOSTROPHE !!! # !!!!!!!! WARNING: FLOODGATE SUPPORT IS AN EXPERIMENTAL FEATURE !!!!!!!! # Enabling this might lead to people gaining unauthorized access to other's accounts! -allowFloodgateNameConflict: 'false' +allowFloodgateNameConflict: false # This enables auto registering every player connecting through Floodgate. # autoLoginFloodgate must be 'true' for this to work