mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-24 03:05:17 +01:00
Separate message for antibot kick
This commit is contained in:
parent
5388f08117
commit
79e6574232
@ -428,13 +428,21 @@ public class AuthMePlayerListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
if (Settings.isKickNonRegisteredEnabled) {
|
||||
if (Settings.isKickNonRegisteredEnabled && !Settings.antiBotInAction){
|
||||
if (!plugin.database.isAuthAvailable(name)) {
|
||||
event.setKickMessage(m.send("reg_only")[0]);
|
||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (Settings.antiBotInAction){
|
||||
if (!plugin.database.isAuthAvailable(name)) {
|
||||
event.setKickMessage(m.send("AntiBot service in action! Non registered players can't connect until the bot attack stops!")[0]); //Need to add string to messages
|
||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if forceSingleSession is set to true, so kick player that has
|
||||
// joined with same nick of online player
|
||||
|
@ -22,6 +22,9 @@ import fr.xephi.authme.security.HashAlgorithm;
|
||||
|
||||
public final class Settings extends YamlConfiguration {
|
||||
|
||||
//This is not an option!
|
||||
public static Boolean antiBotInAction = false;
|
||||
|
||||
public static String PLUGIN_FOLDER = "." + File.separator + "plugins" + File.separator + "AuthMe";
|
||||
public static final String CACHE_FOLDER = Settings.PLUGIN_FOLDER + File.separator + "cache";
|
||||
public static final String AUTH_FILE = Settings.PLUGIN_FOLDER + File.separator + "auths.db";
|
||||
@ -606,9 +609,13 @@ public final class Settings extends YamlConfiguration {
|
||||
}
|
||||
|
||||
public static void switchAntiBotMod(boolean mode) {
|
||||
if (mode)
|
||||
if (mode){
|
||||
isKickNonRegisteredEnabled = true;
|
||||
else isKickNonRegisteredEnabled = configFile.getBoolean("settings.restrictions.kickNonRegistered", false);
|
||||
antiBotInAction = true;
|
||||
}else{
|
||||
isKickNonRegisteredEnabled = configFile.getBoolean("settings.restrictions.kickNonRegistered", false);
|
||||
antiBotInAction = false;
|
||||
}
|
||||
}
|
||||
|
||||
private static void getWelcomeMessage() {
|
||||
|
Loading…
Reference in New Issue
Block a user