mirror of
https://github.com/TuxCoding/FastLogin.git
synced 2025-07-30 10:47:33 +02:00
Added function isValidConfigValue()
This commit is contained in:
@ -43,9 +43,7 @@ public class FloodgateAuthTask implements Runnable {
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
if (!allowNameConflict.equalsIgnoreCase("true")
|
if (!isValidConfigValue(allowNameConflict)) {
|
||||||
&& !allowNameConflict.equalsIgnoreCase("linked")
|
|
||||||
&& !allowNameConflict.equalsIgnoreCase("false")) {
|
|
||||||
plugin.getLog().error(
|
plugin.getLog().error(
|
||||||
"Invalid value detected for 'allowFloodgateNameConflict' in FasttLogin/config.yml. Aborting login of Player {}",
|
"Invalid value detected for 'allowFloodgateNameConflict' in FasttLogin/config.yml. Aborting login of Player {}",
|
||||||
player.getName());
|
player.getName());
|
||||||
@ -89,5 +87,17 @@ public class FloodgateAuthTask implements Runnable {
|
|||||||
Runnable forceLoginTask = new ForceLoginTask(plugin.getCore(), player, session);
|
Runnable forceLoginTask = new ForceLoginTask(plugin.getCore(), player, session);
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, forceLoginTask);
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, forceLoginTask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a string is a valid configuration option for
|
||||||
|
* 'allowFloodgateNameConflict' or 'autoLoginFloodgate'
|
||||||
|
*
|
||||||
|
* @param value The value of 'allowFloodgateNameConflict' or
|
||||||
|
* 'autoLoginFloodgate' from config.yml
|
||||||
|
* @return true if value is "true", "false", or "linked"
|
||||||
|
*/
|
||||||
|
boolean isValidConfigValue(String value) {
|
||||||
|
return value.equalsIgnoreCase("true") || value.equalsIgnoreCase("linked") || value.equalsIgnoreCase("false");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user