diff --git a/pom.xml b/pom.xml index c4fb4e34..f8eaaaf6 100644 --- a/pom.xml +++ b/pom.xml @@ -531,6 +531,30 @@ + + + aliyun-repo + https://maven.aliyun.com/repository/public + + true + + + true + + + + + + tencent-repo + https://mirrors.cloud.tencent.com/nexus/repository/maven-public/ + + true + + + true + + + codemc-repo @@ -598,11 +622,13 @@ true + devmart-other https://nexuslite.gcnt.net/repos/other/ + opencollab-snapshot https://repo.opencollab.dev/maven-snapshots/ @@ -630,7 +656,7 @@ org.geysermc.floodgate api - 2.2.0-SNAPSHOT + 2.2.2-SNAPSHOT provided diff --git a/src/main/java/fr/xephi/authme/listener/GuiCaptchaHandler.java b/src/main/java/fr/xephi/authme/listener/GuiCaptchaHandler.java index 02cfc8a6..32088771 100644 --- a/src/main/java/fr/xephi/authme/listener/GuiCaptchaHandler.java +++ b/src/main/java/fr/xephi/authme/listener/GuiCaptchaHandler.java @@ -118,6 +118,7 @@ public class GuiCaptchaHandler implements Listener { @EventHandler(priority = EventPriority.HIGHEST) public void onPlayerLogin(PlayerLoginEvent event) { + Player player = event.getPlayer(); bukkitService.runTaskAsynchronously(() -> { sb = new StringBuilder(); int howLongIsRandomString = (howManyRandom.nextInt(3) + 1); @@ -131,8 +132,15 @@ public class GuiCaptchaHandler implements Listener { // 将字符追加到字符串生成器 sb.append(randomChar); } + if (!whiteList.isEmpty()) { + String ip = getPlayerIp(player); + if (whiteList.contains(authmeApi.getCountryCode(ip)) && ip != null) { + if (!closeReasonMap.containsKey(player)) { + closeReasonMap.put(player, "verified:whitelist"); + } + } + } }); - } @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST) @@ -140,16 +148,7 @@ public class GuiCaptchaHandler implements Listener { randomString = ""; Player playerunreg = event.getPlayer(); String name = playerunreg.getName(); - if (!authmeApi.isRegistered(name) && !isNpc(playerunreg)) { - if (!whiteList.isEmpty()) { - String ip = getPlayerIp(playerunreg); - if (whiteList.contains(authmeApi.getCountryCode(ip)) && ip != null) { - if (!closeReasonMap.containsKey(playerunreg)) { - closeReasonMap.put(playerunreg, "verified:whitelist"); - } - return; - } - } + if (!authmeApi.isRegistered(name) && !isNpc(playerunreg) && !closeReasonMap.containsKey(playerunreg)) { if (isBedrockPlayer(playerunreg.getUniqueId())) { if (!closeReasonMap.containsKey(playerunreg)) { closeReasonMap.put(playerunreg, "verified:bedrock");