diff --git a/core/src/main/java/moe/caa/multilogin/core/command/SecondaryConfirmationHandler.java b/core/src/main/java/moe/caa/multilogin/core/command/SecondaryConfirmationHandler.java index ffce7efc..05fc3949 100644 --- a/core/src/main/java/moe/caa/multilogin/core/command/SecondaryConfirmationHandler.java +++ b/core/src/main/java/moe/caa/multilogin/core/command/SecondaryConfirmationHandler.java @@ -12,7 +12,6 @@ * 二次确认快处工具 */ public class SecondaryConfirmationHandler { - private static final long confirmValidTimeMillis = 1000 * 15; private final Map concurrentHashMap = new ConcurrentHashMap<>(); private final AtomicReference consoleConfirm = new AtomicReference<>(); @@ -83,7 +82,7 @@ private ConfirmEntry(CallbackConfirmCommand callbackConfirmCommand) { } private boolean isInvalid() { - return subTime + confirmValidTimeMillis < System.currentTimeMillis(); + return subTime + CommandHandler.getCore().getPluginConfig().getConfirmCommandValidTimeMills() < System.currentTimeMillis(); } public void confirm() throws Exception { diff --git a/core/src/main/java/moe/caa/multilogin/core/configuration/PluginConfig.java b/core/src/main/java/moe/caa/multilogin/core/configuration/PluginConfig.java index b06be0d4..282aaeb1 100644 --- a/core/src/main/java/moe/caa/multilogin/core/configuration/PluginConfig.java +++ b/core/src/main/java/moe/caa/multilogin/core/configuration/PluginConfig.java @@ -56,6 +56,8 @@ public class PluginConfig { private boolean welcomeMsg; @Getter private Map serviceIdMap = new HashMap<>(); + @Getter + private long confirmCommandValidTimeMills; public PluginConfig(File dataFolder, MultiCore core) { this.dataFolder = dataFolder; @@ -101,6 +103,7 @@ public void reload() throws IOException, URISyntaxException { welcomeMsg = configConfigurationNode.node("welcomeMsg").getBoolean(true); nameCorrect = configConfigurationNode.node("nameCorrect").getBoolean(true); autoNameChange = configConfigurationNode.node("autoNameChange").getBoolean(true); + confirmCommandValidTimeMills = configConfigurationNode.node("confirmCommandValidTimeMills").getLong(15000); Map idMap = new HashMap<>(); try (Stream list = Files.list(servicesFolder.toPath())) { diff --git a/core/src/main/resources/config.yml b/core/src/main/resources/config.yml index e0fe958c..144f8ecb 100644 --- a/core/src/main/resources/config.yml +++ b/core/src/main/resources/config.yml @@ -57,6 +57,11 @@ nameCorrect: true # 默认值 true autoNameChange: true +# 风险指令二次确认过期时间设置 +# +# 默认值 15000 +confirmCommandValidTimeMills: 15000 + # 插件数据设置 sql: diff --git a/core/src/main/resources/examples/elyby.yml b/core/src/main/resources/examples/elyby.yml new file mode 100644 index 00000000..06cedcdd --- /dev/null +++ b/core/src/main/resources/examples/elyby.yml @@ -0,0 +1,15 @@ +# Below, only the most basic configuration is provided. +# You can refer to the template file to complete all configurations. + +# Please edit before use. +id: -1 + +name: 'ely.by' + +# Don't change it unless you really want to. +serviceType: CUSTOM_YGGDRASIL +yggdrasilAuth: + custom: + method: 'GET' + url: 'https://authserver.ely.by/session/hasJoined?username={0}&serverId={1}{2}' + trackIpContent: '&ip={0}' diff --git a/gradle.properties b/gradle.properties index 9c470651..beaa68c6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ -plugin_version=0.6.7 -org.gradle.jvmargs=-Xmx1024m \ No newline at end of file +plugin_version=0.6.10 +org.gradle.jvmargs=-Xmx1024m diff --git a/latest b/latest index fae59cac..04e84f89 100644 --- a/latest +++ b/latest @@ -1 +1 @@ -0.6.8 +0.6.10