删测测试项 默认开启用户名限制并增加默认限制用户
This commit is contained in:
parent
ea1af80ea4
commit
e109094472
@ -2,7 +2,6 @@ package fr.xephi.authme;
|
|||||||
|
|
||||||
import ch.jalu.injector.Injector;
|
import ch.jalu.injector.Injector;
|
||||||
import ch.jalu.injector.InjectorBuilder;
|
import ch.jalu.injector.InjectorBuilder;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
|
||||||
import fr.xephi.authme.api.v3.AuthMeApi;
|
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||||
import fr.xephi.authme.command.CommandHandler;
|
import fr.xephi.authme.command.CommandHandler;
|
||||||
import fr.xephi.authme.datasource.DataSource;
|
import fr.xephi.authme.datasource.DataSource;
|
||||||
@ -37,16 +36,15 @@ import fr.xephi.authme.util.ExceptionUtils;
|
|||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.plugin.PluginDescriptionFile;
|
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.plugin.java.JavaPluginLoader;
|
|
||||||
import org.bukkit.scheduler.BukkitScheduler;
|
import org.bukkit.scheduler.BukkitScheduler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
import static fr.xephi.authme.service.BukkitService.TICKS_PER_MINUTE;
|
import static fr.xephi.authme.service.BukkitService.TICKS_PER_MINUTE;
|
||||||
@ -82,14 +80,6 @@ public class AuthMe extends JavaPlugin {
|
|||||||
public AuthMe() {
|
public AuthMe() {
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Constructor for unit testing.
|
|
||||||
*/
|
|
||||||
@VisibleForTesting
|
|
||||||
AuthMe(JavaPluginLoader loader, PluginDescriptionFile description, File dataFolder, File file) {
|
|
||||||
super(loader, description, dataFolder, file);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the plugin's name.
|
* Get the plugin's name.
|
||||||
*
|
*
|
||||||
@ -156,7 +146,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
th.printStackTrace();
|
th.printStackTrace();
|
||||||
} else {
|
} else {
|
||||||
logger.logException("File '" + yamlParseException.getFile() + "' contains invalid YAML. "
|
logger.logException("File '" + yamlParseException.getFile() + "' contains invalid YAML. "
|
||||||
+ "Please run its contents through http://yamllint.com", yamlParseException);
|
+ "Please run its contents through https://yamllint.com", yamlParseException);
|
||||||
}
|
}
|
||||||
stopOrUnload();
|
stopOrUnload();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -10,7 +10,7 @@ public final class EmailSettings implements SettingsHolder {
|
|||||||
|
|
||||||
@Comment("Email SMTP server host")
|
@Comment("Email SMTP server host")
|
||||||
public static final Property<String> SMTP_HOST =
|
public static final Property<String> SMTP_HOST =
|
||||||
newProperty("Email.mailSMTP", "smtp.gmail.com");
|
newProperty("Email.mailSMTP", "smtp.163.com");
|
||||||
|
|
||||||
@Comment("Email SMTP server port")
|
@Comment("Email SMTP server port")
|
||||||
public static final Property<Integer> SMTP_PORT =
|
public static final Property<Integer> SMTP_PORT =
|
||||||
|
|||||||
@ -74,7 +74,7 @@ public final class RestrictionSettings implements SettingsHolder {
|
|||||||
"To activate the restricted user feature you need",
|
"To activate the restricted user feature you need",
|
||||||
"to enable this option and configure the AllowedRestrictedUser field."})
|
"to enable this option and configure the AllowedRestrictedUser field."})
|
||||||
public static final Property<Boolean> ENABLE_RESTRICTED_USERS =
|
public static final Property<Boolean> ENABLE_RESTRICTED_USERS =
|
||||||
newProperty("settings.restrictions.AllowRestrictedUser", false);
|
newProperty("settings.restrictions.AllowRestrictedUser", true);
|
||||||
|
|
||||||
@Comment({
|
@Comment({
|
||||||
"The restricted user feature will kick players listed below",
|
"The restricted user feature will kick players listed below",
|
||||||
@ -85,7 +85,12 @@ public final class RestrictionSettings implements SettingsHolder {
|
|||||||
" - playername;127.0.0.1",
|
" - playername;127.0.0.1",
|
||||||
" - playername;regex:127\\.0\\.0\\..*"})
|
" - playername;regex:127\\.0\\.0\\..*"})
|
||||||
public static final Property<Set<String>> RESTRICTED_USERS =
|
public static final Property<Set<String>> RESTRICTED_USERS =
|
||||||
newLowercaseStringSetProperty("settings.restrictions.AllowedRestrictedUser","Sattera;127.0.0.1","Server_Land;127.0.0.1");
|
newLowercaseStringSetProperty("settings.restrictions.AllowedRestrictedUser",
|
||||||
|
"server_land;127.0.0.1","server;127.0.0.1","bukkit;127.0.0.1","purpur;127.0.0.1",
|
||||||
|
"system;127.0.0.1","admin;127.0.0.1","md_5;127.0.0.1","administrator;127.0.0.1","notch;127.0.0.1",
|
||||||
|
"spigot;127.0.0.1","bukkit;127.0.0.1","bukkitcraft;127.0.0.1","paperclip;127.0.0.1","papermc;127.0.0.1",
|
||||||
|
"spigotmc;127.0.0.1","root;127.0.0.1","console;127.0.0.1","purpur;127.0.0.1","authme;127.0.0.1",
|
||||||
|
"owner;127.0.0.1");
|
||||||
|
|
||||||
@Comment("Ban unknown IPs trying to log in with a restricted username?")
|
@Comment("Ban unknown IPs trying to log in with a restricted username?")
|
||||||
public static final Property<Boolean> BAN_UNKNOWN_IP =
|
public static final Property<Boolean> BAN_UNKNOWN_IP =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user