Merge branches 'master' and 'passwd_recovery_process' of https://github.com/AuthMe/AuthMeReloaded into passwd_recovery_process
# Conflicts: # docs/config.md # src/main/resources/messages/messages_bg.yml # src/main/resources/messages/messages_es.yml # src/main/resources/messages/messages_pt.yml # src/main/resources/messages/messages_zhcn.yml
This commit is contained in:
@@ -74,7 +74,7 @@ public class CommandManager implements Reloadable {
|
||||
|
||||
private void executeCommands(Player player, List<Command> commands) {
|
||||
for (Command command : commands) {
|
||||
final String execution = command.getCommand().replace("%p", player.getName());
|
||||
final String execution = command.getCommand();
|
||||
if (Executor.CONSOLE.equals(command.getExecutor())) {
|
||||
bukkitService.dispatchConsoleCommand(execution);
|
||||
} else {
|
||||
|
||||
@@ -20,9 +20,9 @@ public final class AuthMeSettingsRetriever {
|
||||
*/
|
||||
public static ConfigurationData buildConfigurationData() {
|
||||
return ConfigurationDataBuilder.collectData(
|
||||
DatabaseSettings.class, ConverterSettings.class, PluginSettings.class,
|
||||
RestrictionSettings.class, EmailSettings.class, HooksSettings.class,
|
||||
ProtectionSettings.class, PurgeSettings.class, SecuritySettings.class,
|
||||
RegistrationSettings.class, BackupSettings.class);
|
||||
DatabaseSettings.class, PluginSettings.class, RestrictionSettings.class,
|
||||
EmailSettings.class, HooksSettings.class, ProtectionSettings.class,
|
||||
PurgeSettings.class, SecuritySettings.class, RegistrationSettings.class,
|
||||
LimboSettings.class, BackupSettings.class, ConverterSettings.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import ch.jalu.configme.properties.Property;
|
||||
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||
|
||||
public class BackupSettings implements SettingsHolder {
|
||||
public final class BackupSettings implements SettingsHolder {
|
||||
|
||||
@Comment("Enable or disable automatic backup")
|
||||
public static final Property<Boolean> ENABLED =
|
||||
|
||||
@@ -6,7 +6,7 @@ import ch.jalu.configme.properties.Property;
|
||||
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||
|
||||
public class ConverterSettings implements SettingsHolder {
|
||||
public final class ConverterSettings implements SettingsHolder {
|
||||
|
||||
@Comment("Rakamak file name")
|
||||
public static final Property<String> RAKAMAK_FILE_NAME =
|
||||
|
||||
@@ -7,10 +7,10 @@ import fr.xephi.authme.datasource.DataSourceType;
|
||||
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||
|
||||
public class DatabaseSettings implements SettingsHolder {
|
||||
public final class DatabaseSettings implements SettingsHolder {
|
||||
|
||||
@Comment({"What type of database do you want to use?",
|
||||
"Valid values: sqlite, mysql"})
|
||||
"Valid values: SQLITE, MYSQL"})
|
||||
public static final Property<DataSourceType> BACKEND =
|
||||
newProperty(DataSourceType.class, "DataSource.backend", DataSourceType.SQLITE);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newListProperty;
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||
|
||||
public class EmailSettings implements SettingsHolder {
|
||||
public final class EmailSettings implements SettingsHolder {
|
||||
|
||||
@Comment("Email SMTP server host")
|
||||
public static final Property<String> SMTP_HOST =
|
||||
|
||||
@@ -9,7 +9,7 @@ import java.util.List;
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newListProperty;
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||
|
||||
public class HooksSettings implements SettingsHolder {
|
||||
public final class HooksSettings implements SettingsHolder {
|
||||
|
||||
@Comment("Do we need to hook with multiverse for spawn checking?")
|
||||
public static final Property<Boolean> MULTIVERSE =
|
||||
@@ -54,6 +54,18 @@ public class HooksSettings implements SettingsHolder {
|
||||
public static final Property<Integer> PHPBB_ACTIVATED_GROUP_ID =
|
||||
newProperty("ExternalBoardOptions.phpbbActivatedGroupId", 2);
|
||||
|
||||
@Comment("IP Board table prefix defined during the IP Board installation process")
|
||||
public static final Property<String> IPB_TABLE_PREFIX =
|
||||
newProperty("ExternalBoardOptions.IPBTablePrefix", "ipb_");
|
||||
|
||||
@Comment("IP Board default group ID; 3 is the default registered group defined by IP Board")
|
||||
public static final Property<Integer> IPB_ACTIVATED_GROUP_ID =
|
||||
newProperty("ExternalBoardOptions.IPBActivatedGroupId", 3);
|
||||
|
||||
@Comment("XenForo default group ID; 2 is the default registered group defined by Xenforo")
|
||||
public static final Property<Integer> XF_ACTIVATED_GROUP_ID =
|
||||
newProperty("ExternalBoardOptions.XFActivatedGroupId", 2);
|
||||
|
||||
@Comment("Wordpress prefix defined during WordPress installation")
|
||||
public static final Property<String> WORDPRESS_TABLE_PREFIX =
|
||||
newProperty("ExternalBoardOptions.wordpressTablePrefix", "wp_");
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
package fr.xephi.authme.settings.properties;
|
||||
|
||||
import ch.jalu.configme.Comment;
|
||||
import ch.jalu.configme.SectionComments;
|
||||
import ch.jalu.configme.SettingsHolder;
|
||||
import ch.jalu.configme.properties.Property;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import fr.xephi.authme.data.limbo.AllowFlightRestoreType;
|
||||
import fr.xephi.authme.data.limbo.WalkFlySpeedRestoreType;
|
||||
import fr.xephi.authme.data.limbo.persistence.LimboPersistenceType;
|
||||
import fr.xephi.authme.data.limbo.persistence.SegmentConfiguration;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||
|
||||
/**
|
||||
* Settings for the LimboPlayer feature.
|
||||
*/
|
||||
public final class LimboSettings implements SettingsHolder {
|
||||
|
||||
@Comment({
|
||||
"Besides storing the data in memory, you can define if/how the data should be persisted",
|
||||
"on disk. This is useful in case of a server crash, so next time the server starts we can",
|
||||
"properly restore things like OP status, ability to fly, and walk/fly speed.",
|
||||
"DISABLED: no disk storage, INDIVIDUAL_FILES: each player data in its own file,",
|
||||
"SINGLE_FILE: all data in one single file (only if you have a small server!)",
|
||||
"SEGMENT_FILES: distributes players into different buckets based on their UUID. See below."
|
||||
})
|
||||
public static final Property<LimboPersistenceType> LIMBO_PERSISTENCE_TYPE =
|
||||
newProperty(LimboPersistenceType.class, "limbo.persistence.type", LimboPersistenceType.INDIVIDUAL_FILES);
|
||||
|
||||
@Comment({
|
||||
"This setting only affects SEGMENT_FILES persistence. The segment file",
|
||||
"persistence attempts to reduce the number of files by distributing players into various",
|
||||
"buckets based on their UUID. This setting defines into how many files the players should",
|
||||
"be distributed. Possible values: ONE, FOUR, EIGHT, SIXTEEN, THIRTY_TWO, SIXTY_FOUR,",
|
||||
"ONE_TWENTY for 128, TWO_FIFTY for 256.",
|
||||
"For example, if you expect 100 non-logged in players, setting to SIXTEEN will average",
|
||||
"6.25 players per file (100 / 16). If you set to ONE, like persistence SINGLE_FILE, only",
|
||||
"one file will be used. Contrary to SINGLE_FILE, it won't keep the entries in cache, which",
|
||||
"may deliver different results in terms of performance.",
|
||||
"Note: if you change this setting all data will be migrated. If you have a lot of data,",
|
||||
"change this setting only on server restart, not with /authme reload."
|
||||
})
|
||||
public static final Property<SegmentConfiguration> SEGMENT_DISTRIBUTION =
|
||||
newProperty(SegmentConfiguration.class, "limbo.persistence.segmentDistribution", SegmentConfiguration.SIXTEEN);
|
||||
|
||||
@Comment({
|
||||
"Whether the player is allowed to fly: RESTORE, ENABLE, DISABLE.",
|
||||
"RESTORE sets back the old property from the player."
|
||||
})
|
||||
public static final Property<AllowFlightRestoreType> RESTORE_ALLOW_FLIGHT =
|
||||
newProperty(AllowFlightRestoreType.class, "limbo.restoreAllowFlight", AllowFlightRestoreType.RESTORE);
|
||||
|
||||
@Comment({
|
||||
"Restore fly speed: RESTORE, DEFAULT, MAX_RESTORE, RESTORE_NO_ZERO.",
|
||||
"RESTORE: restore the speed the player had;",
|
||||
"DEFAULT: always set to default speed;",
|
||||
"MAX_RESTORE: take the maximum of the player's current speed and the previous one",
|
||||
"RESTORE_NO_ZERO: Like 'restore' but sets speed to default if the player's speed was 0"
|
||||
})
|
||||
public static final Property<WalkFlySpeedRestoreType> RESTORE_FLY_SPEED =
|
||||
newProperty(WalkFlySpeedRestoreType.class, "limbo.restoreFlySpeed", WalkFlySpeedRestoreType.MAX_RESTORE);
|
||||
|
||||
@Comment({
|
||||
"Restore walk speed: RESTORE, DEFAULT, MAX_RESTORE, RESTORE_NO_ZERO.",
|
||||
"See above for a description of the values."
|
||||
})
|
||||
public static final Property<WalkFlySpeedRestoreType> RESTORE_WALK_SPEED =
|
||||
newProperty(WalkFlySpeedRestoreType.class, "limbo.restoreWalkSpeed", WalkFlySpeedRestoreType.MAX_RESTORE);
|
||||
|
||||
private LimboSettings() {
|
||||
}
|
||||
|
||||
@SectionComments
|
||||
public static Map<String, String[]> createSectionComments() {
|
||||
String[] limboExplanation = {
|
||||
"Before a user logs in, various properties are temporarily removed from the player,",
|
||||
"such as OP status, ability to fly, and walk/fly speed.",
|
||||
"Once the user is logged in, we add back the properties we previously saved.",
|
||||
"In this section, you may define how these properties should be handled."
|
||||
};
|
||||
return ImmutableMap.of("limbo", limboExplanation);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import fr.xephi.authme.output.LogLevel;
|
||||
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||
|
||||
public class PluginSettings implements SettingsHolder {
|
||||
public final class PluginSettings implements SettingsHolder {
|
||||
|
||||
@Comment({
|
||||
"Do you want to enable the session feature?",
|
||||
|
||||
@@ -10,7 +10,7 @@ import static ch.jalu.configme.properties.PropertyInitializer.newListProperty;
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||
|
||||
|
||||
public class ProtectionSettings implements SettingsHolder {
|
||||
public final class ProtectionSettings implements SettingsHolder {
|
||||
|
||||
@Comment("Enable some servers protection (country based login, antibot)")
|
||||
public static final Property<Boolean> ENABLE_PROTECTION =
|
||||
|
||||
@@ -6,7 +6,7 @@ import ch.jalu.configme.properties.Property;
|
||||
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||
|
||||
public class PurgeSettings implements SettingsHolder {
|
||||
public final class PurgeSettings implements SettingsHolder {
|
||||
|
||||
@Comment("If enabled, AuthMe automatically purges old, unused accounts")
|
||||
public static final Property<Boolean> USE_AUTO_PURGE =
|
||||
|
||||
@@ -8,7 +8,7 @@ import fr.xephi.authme.process.register.RegistrationType;
|
||||
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||
|
||||
public class RegistrationSettings implements SettingsHolder {
|
||||
public final class RegistrationSettings implements SettingsHolder {
|
||||
|
||||
@Comment("Enable registration on the server?")
|
||||
public static final Property<Boolean> IS_ENABLED =
|
||||
@@ -42,7 +42,8 @@ public class RegistrationSettings implements SettingsHolder {
|
||||
"EMAIL_MANDATORY = for password register: 2nd argument MUST be an email address"
|
||||
})
|
||||
public static final Property<RegisterSecondaryArgument> REGISTER_SECOND_ARGUMENT =
|
||||
newProperty(RegisterSecondaryArgument.class, "settings.registration.secondArg", RegisterSecondaryArgument.CONFIRMATION);
|
||||
newProperty(RegisterSecondaryArgument.class, "settings.registration.secondArg",
|
||||
RegisterSecondaryArgument.CONFIRMATION);
|
||||
|
||||
@Comment({
|
||||
"Do we force kick a player after a successful registration?",
|
||||
|
||||
@@ -10,7 +10,7 @@ import static ch.jalu.configme.properties.PropertyInitializer.newListProperty;
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newLowercaseListProperty;
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||
|
||||
public class RestrictionSettings implements SettingsHolder {
|
||||
public final class RestrictionSettings implements SettingsHolder {
|
||||
|
||||
@Comment({
|
||||
"Can not authenticated players chat?",
|
||||
@@ -81,7 +81,7 @@ public class RestrictionSettings implements SettingsHolder {
|
||||
"Example:",
|
||||
" AllowedRestrictedUser:",
|
||||
" - playername;127.0.0.1"})
|
||||
public static final Property<List<String>> ALLOWED_RESTRICTED_USERS =
|
||||
public static final Property<List<String>> RESTRICTED_USERS =
|
||||
newLowercaseListProperty("settings.restrictions.AllowedRestrictedUser");
|
||||
|
||||
@Comment("Ban unknown IPs trying to log in with a restricted username?")
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.util.Set;
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newLowercaseListProperty;
|
||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||
|
||||
public class SecuritySettings implements SettingsHolder {
|
||||
public final class SecuritySettings implements SettingsHolder {
|
||||
|
||||
@Comment({"Stop the server if we can't contact the sql database",
|
||||
"Take care with this, if you set this to false,",
|
||||
@@ -86,7 +86,8 @@ public class SecuritySettings implements SettingsHolder {
|
||||
"- 'password'",
|
||||
"- 'help'"})
|
||||
public static final Property<List<String>> UNSAFE_PASSWORDS =
|
||||
newLowercaseListProperty("settings.security.unsafePasswords", "123456", "password", "qwerty", "12345", "54321", "123456789", "help");
|
||||
newLowercaseListProperty("settings.security.unsafePasswords",
|
||||
"123456", "password", "qwerty", "12345", "54321", "123456789", "help");
|
||||
|
||||
@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 =
|
||||
|
||||
Reference in New Issue
Block a user