kick player on tempban, change setting comments to better reflect the process

This commit is contained in:
EbonJaguar 2016-06-13 14:55:25 -04:00
parent 221ce13176
commit b7015f56c2
2 changed files with 5 additions and 4 deletions

View File

@ -86,7 +86,7 @@ public class TempbanManager implements SettingsDependent {
* *
* @param player The player to tempban * @param player The player to tempban
*/ */
public void tempbanPlayer(Player player) { public void tempbanPlayer(final Player player) {
if (isEnabled) { if (isEnabled) {
resetCount(player.getName()); resetCount(player.getName());
@ -101,6 +101,7 @@ public class TempbanManager implements SettingsDependent {
@Override @Override
public void run() { public void run() {
Bukkit.getServer().getBanList(BanList.Type.IP).addBan(ip, reason, expires, "AuthMe"); Bukkit.getServer().getBanList(BanList.Type.IP).addBan(ip, reason, expires, "AuthMe");
player.kickPlayer(reason);
} }
}); });
} }

View File

@ -100,15 +100,15 @@ public class SecuritySettings implements SettingsClass {
public static final Property<List<String>> UNSAFE_PASSWORDS = public static final Property<List<String>> UNSAFE_PASSWORDS =
newLowercaseListProperty("settings.security.unsafePasswords", "123456", "password", "qwerty", "12345", "54321"); newLowercaseListProperty("settings.security.unsafePasswords", "123456", "password", "qwerty", "12345", "54321");
@Comment("Tempban users if they enter the wrong password too many times") @Comment("Tempban a user's IP address if they enter the wrong password too many times")
public static final Property<Boolean> TEMPBAN_ON_MAX_LOGINS = public static final Property<Boolean> TEMPBAN_ON_MAX_LOGINS =
newProperty("Security.tempban.enableTempban", false); newProperty("Security.tempban.enableTempban", false);
@Comment("How many times a user can attempt to login before being tempbanned") @Comment("How many times a user can attempt to login before their IP being tempbanned")
public static final Property<Integer> MAX_LOGIN_TEMPBAN = public static final Property<Integer> MAX_LOGIN_TEMPBAN =
newProperty("Security.tempban.maxLoginTries", 10); newProperty("Security.tempban.maxLoginTries", 10);
@Comment({"The length of time a player will be tempbanned in minutes", @Comment({"The length of time a IP address will be tempbanned in minutes",
"Default: 480 minutes, or 8 hours"}) "Default: 480 minutes, or 8 hours"})
public static final Property<Integer> TEMPBAN_LENGTH = public static final Property<Integer> TEMPBAN_LENGTH =
newProperty("Security.tempban.tempbanLength", 480); newProperty("Security.tempban.tempbanLength", 480);