mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-24 11:15:19 +01:00
Separate message for antibot kick
This commit is contained in:
parent
5388f08117
commit
79e6574232
@ -428,7 +428,7 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.isKickNonRegisteredEnabled) {
|
if (Settings.isKickNonRegisteredEnabled && !Settings.antiBotInAction){
|
||||||
if (!plugin.database.isAuthAvailable(name)) {
|
if (!plugin.database.isAuthAvailable(name)) {
|
||||||
event.setKickMessage(m.send("reg_only")[0]);
|
event.setKickMessage(m.send("reg_only")[0]);
|
||||||
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
event.setResult(PlayerLoginEvent.Result.KICK_OTHER);
|
||||||
@ -436,6 +436,14 @@ public class AuthMePlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
// Check if forceSingleSession is set to true, so kick player that has
|
||||||
// joined with same nick of online player
|
// joined with same nick of online player
|
||||||
if (player.isOnline() && Settings.isForceSingleSessionEnabled) {
|
if (player.isOnline() && Settings.isForceSingleSessionEnabled) {
|
||||||
|
@ -22,6 +22,9 @@ import fr.xephi.authme.security.HashAlgorithm;
|
|||||||
|
|
||||||
public final class Settings extends YamlConfiguration {
|
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 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 CACHE_FOLDER = Settings.PLUGIN_FOLDER + File.separator + "cache";
|
||||||
public static final String AUTH_FILE = Settings.PLUGIN_FOLDER + File.separator + "auths.db";
|
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) {
|
public static void switchAntiBotMod(boolean mode) {
|
||||||
if (mode)
|
if (mode){
|
||||||
isKickNonRegisteredEnabled = true;
|
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() {
|
private static void getWelcomeMessage() {
|
||||||
|
Loading…
Reference in New Issue
Block a user