Compare commits
20 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 010874586a | |||
| fcc34c28aa | |||
| ecbc11cf0b | |||
| bfd3a8f439 | |||
| f8dd410d96 | |||
| 2459aec4b6 | |||
| d623337a15 | |||
| 73c3cea778 | |||
| 11a4cff10a | |||
| 628d5adcb5 | |||
| 8681cd0733 | |||
| bb2fdbfb40 | |||
| 4dedc30d94 | |||
| fa995eea53 | |||
| e819be918b | |||
| 1e3e625c1a | |||
| b747a4bdff | |||
| 03443104be | |||
| 819e55e235 | |||
| 80b06f3bc7 |
@@ -784,14 +784,6 @@
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- FastUtil -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>it.unimi.dsi</groupId>-->
|
||||
<!-- <artifactId>fastutil-core</artifactId>-->
|
||||
<!-- <version>8.5.12</version>-->
|
||||
<!-- <scope>provided</scope>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- ConfigMe -->
|
||||
<dependency>
|
||||
<groupId>ch.jalu</groupId>
|
||||
@@ -806,7 +798,7 @@
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!-- bStats metrics -->
|
||||
<!-- bStats metrics -->
|
||||
<dependency>
|
||||
<groupId>org.bstats</groupId>
|
||||
<artifactId>bstats-bukkit</artifactId>
|
||||
@@ -1076,7 +1068,7 @@
|
||||
<dependency>
|
||||
<groupId>org.checkerframework</groupId>
|
||||
<artifactId>checker-qual</artifactId>
|
||||
<version>3.39.0</version>
|
||||
<version>3.40.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
@@ -1084,7 +1076,7 @@
|
||||
<dependency>
|
||||
<groupId>org.xerial</groupId>
|
||||
<artifactId>sqlite-jdbc</artifactId>
|
||||
<version>3.43.2.1</version>
|
||||
<version>3.43.2.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@@ -43,6 +43,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
@@ -76,7 +77,7 @@ public class AuthMe extends JavaPlugin {
|
||||
// Version and build number values
|
||||
private static String pluginVersion = "5.6.0-Fork";
|
||||
private static final String pluginBuild = "b";
|
||||
private static String pluginBuildNumber = "30";
|
||||
private static String pluginBuildNumber = "31";
|
||||
protected final Boolean SHAEnabled = false;
|
||||
// Private instances
|
||||
private EmailService emailService;
|
||||
@@ -123,6 +124,7 @@ public class AuthMe extends JavaPlugin {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Method called when the server enables the plugin.
|
||||
*/
|
||||
@@ -229,16 +231,16 @@ public class AuthMe extends JavaPlugin {
|
||||
if (settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_UNDERGROUND) || settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_PORTAL)) {
|
||||
getServer().getPluginManager().registerEvents(new LoginLocationFixListener((Plugin) this), this);
|
||||
}
|
||||
if (settings.getProperty(SecuritySettings.FORCE_LOGIN_BEDROCK) && settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) && getServer().getPluginManager().getPlugin("floodgate") != null) {
|
||||
getServer().getPluginManager().registerEvents(new BedrockAutoLoginListener((Plugin) this), this);
|
||||
}
|
||||
if (settings.getProperty(SecuritySettings.GUI_CAPTCHA) && getServer().getPluginManager().getPlugin("ProtocolLib") != null) {
|
||||
getServer().getPluginManager().registerEvents(new GuiCaptchaHandler((Plugin) this), this);
|
||||
logger.info("(Beta)GUICaptcha is enabled successfully!");
|
||||
logger.info("These features are still in early development, if you encountered any problem, please report.");
|
||||
} else if (settings.getProperty(SecuritySettings.GUI_CAPTCHA) && getServer().getPluginManager().getPlugin("ProtocolLib") == null) {
|
||||
logger.warning("ProtocolLib is not loaded, can't enable GUI Captcha.");
|
||||
}
|
||||
// if (settings.getProperty(SecuritySettings.FORCE_LOGIN_BEDROCK) && settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) && getServer().getPluginManager().getPlugin("floodgate") != null) {
|
||||
// getServer().getPluginManager().registerEvents(new BedrockAutoLoginListener((Plugin) this), this);
|
||||
// }
|
||||
// if (settings.getProperty(SecuritySettings.GUI_CAPTCHA) && getServer().getPluginManager().getPlugin("ProtocolLib") != null) {
|
||||
// getServer().getPluginManager().registerEvents(new GuiCaptchaHandler((Plugin) this), this);
|
||||
// logger.info("(Beta)GUICaptcha is enabled successfully!");
|
||||
// logger.info("These features are still in early development, if you encountered any problem, please report.");
|
||||
// } else if (settings.getProperty(SecuritySettings.GUI_CAPTCHA) && getServer().getPluginManager().getPlugin("ProtocolLib") == null) {
|
||||
// logger.warning("ProtocolLib is not loaded, can't enable GUI Captcha.");
|
||||
// }
|
||||
}
|
||||
/**
|
||||
* Load the version and build number of the plugin from the description file.
|
||||
@@ -334,8 +336,21 @@ public class AuthMe extends JavaPlugin {
|
||||
pluginManager.registerEvents(injector.getSingleton(EntityListener.class), this);
|
||||
pluginManager.registerEvents(injector.getSingleton(ServerListener.class), this);
|
||||
|
||||
//Register 3rd party listeners
|
||||
if (settings.getProperty(SecuritySettings.GUI_CAPTCHA) && getServer().getPluginManager().getPlugin("ProtocolLib") != null) {
|
||||
pluginManager.registerEvents(injector.getSingleton(GuiCaptchaHandler.class), this);
|
||||
logger.info("(Beta)GUICaptcha is enabled successfully!");
|
||||
logger.info("These features are still in early development, if you encountered any problem, please report.");
|
||||
} else if (settings.getProperty(SecuritySettings.GUI_CAPTCHA) && getServer().getPluginManager().getPlugin("ProtocolLib") == null) {
|
||||
logger.warning("ProtocolLib is not loaded, can't enable GUI Captcha.");
|
||||
}
|
||||
if (settings.getProperty(SecuritySettings.FORCE_LOGIN_BEDROCK) && settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) && getServer().getPluginManager().getPlugin("floodgate") != null) {
|
||||
pluginManager.registerEvents(injector.getSingleton(BedrockAutoLoginListener.class), this);
|
||||
}
|
||||
|
||||
|
||||
// Try to register 1.8+ player listeners
|
||||
if (isClassLoaded("org.bukkit.event.entity.EntityPickupItemEvent") && isClassLoaded("org.bukkit.event.player.PlayerSwapHandItemsEvent")){
|
||||
if (isClassLoaded("org.bukkit.event.entity.EntityPickupItemEvent") && isClassLoaded("org.bukkit.event.player.PlayerSwapHandItemsEvent")) {
|
||||
pluginManager.registerEvents(injector.getSingleton(PlayerListenerHigherThan18.class), this);
|
||||
} else if (isClassLoaded("org.bukkit.event.player.PlayerSwapHandItemsEvent")) {
|
||||
pluginManager.registerEvents(injector.getSingleton(PlayerListener19.class), this);
|
||||
@@ -395,6 +410,7 @@ public class AuthMe extends JavaPlugin {
|
||||
|
||||
// Disabled correctly
|
||||
Consumer<String> infoLogMethod = logger == null ? getLogger()::info : logger::info;
|
||||
HandlerList.unregisterAll(this);
|
||||
infoLogMethod.accept("AuthMe " + this.getDescription().getVersion() + " is unloaded successfully!");
|
||||
ConsoleLogger.closeFileWriter();
|
||||
}
|
||||
@@ -427,7 +443,8 @@ public class AuthMe extends JavaPlugin {
|
||||
getLogger().log(Level.INFO, "You are running the latest version.");
|
||||
}
|
||||
} catch (IOException e) {
|
||||
getLogger().log(Level.WARNING, "Error occurred while checking updates from GitHub. Reason: " + e.getMessage());
|
||||
String formattedException = ExceptionUtils.formatException(e);
|
||||
getLogger().log(Level.WARNING, "Error occurred while checking updates from GitHub. Reason: " + formattedException);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package fr.xephi.authme.listener;
|
||||
/* Inspired by DongShaoNB/BedrockPlayerSupport **/
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||
import fr.xephi.authme.service.BukkitService;
|
||||
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -9,18 +11,21 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.util.UUID;
|
||||
|
||||
import static org.bukkit.Bukkit.getServer;
|
||||
|
||||
public class BedrockAutoLoginListener implements Listener {
|
||||
private final AuthMeApi authmeApi = AuthMeApi.getInstance();
|
||||
private final Plugin plugin;
|
||||
@Inject
|
||||
private BukkitService bukkitService;
|
||||
@Inject
|
||||
private AuthMe plugin;
|
||||
|
||||
public BedrockAutoLoginListener(Plugin plugin) {
|
||||
this.plugin = plugin;
|
||||
|
||||
public BedrockAutoLoginListener() {
|
||||
}
|
||||
|
||||
private boolean isBedrockPlayer(UUID uuid) {
|
||||
@@ -37,4 +42,15 @@ public class BedrockAutoLoginListener implements Listener {
|
||||
player.sendMessage("§a基岩版自动登录完成!");
|
||||
}
|
||||
}
|
||||
|
||||
/* prevent sending duplicate messages */
|
||||
// @EventHandler(priority = EventPriority.HIGHEST)
|
||||
// public void onPlayerRestoreSession(RestoreSessionEvent event) {
|
||||
// Player player = event.getPlayer();
|
||||
// String name = event.getPlayer().getName();
|
||||
// UUID uuid = event.getPlayer().getUniqueId();
|
||||
// if (isBedrockPlayer(uuid) && !authmeApi.isAuthenticated(player) && authmeApi.isRegistered(name)) {
|
||||
// event.setCancelled(true);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ import com.comphenix.protocol.events.PacketAdapter;
|
||||
import com.comphenix.protocol.events.PacketEvent;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.message.Messages;
|
||||
import fr.xephi.authme.service.BukkitService;
|
||||
import fr.xephi.authme.service.CommonService;
|
||||
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
@@ -22,8 +26,8 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import java.io.File;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
@@ -31,12 +35,22 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import static fr.xephi.authme.util.PlayerUtils.isNpc;
|
||||
import static org.bukkit.Bukkit.getLogger;
|
||||
import static org.bukkit.Bukkit.getServer;
|
||||
public class GuiCaptchaHandler implements Listener{
|
||||
|
||||
public class GuiCaptchaHandler implements Listener {
|
||||
//define AuthMeApi
|
||||
private final AuthMeApi authmeApi = AuthMeApi.getInstance();
|
||||
private final Plugin plugin;
|
||||
@Inject
|
||||
private BukkitService bukkitService;
|
||||
@Inject
|
||||
private AuthMe plugin;
|
||||
@Inject
|
||||
private Messages messages;
|
||||
@Inject
|
||||
private CommonService service;
|
||||
|
||||
private PacketAdapter chatPacketListener;
|
||||
private PacketAdapter windowPacketListener;
|
||||
//define timesLeft
|
||||
@@ -53,14 +67,18 @@ public class GuiCaptchaHandler implements Listener{
|
||||
|
||||
int howLongIsRandomString = (howManyRandom.nextInt(3) + 1);
|
||||
|
||||
public GuiCaptchaHandler(Plugin plugin) {
|
||||
this.plugin = plugin;
|
||||
public GuiCaptchaHandler() {
|
||||
}
|
||||
|
||||
private boolean isBedrockPlayer(UUID uuid) {
|
||||
return AuthMe.settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) && AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_BE_COMPATIBILITY) && org.geysermc.floodgate.api.FloodgateApi.getInstance().isFloodgateId(uuid) && getServer().getPluginManager().getPlugin("floodgate") != null;
|
||||
}
|
||||
|
||||
private void removePacketListeners() {
|
||||
ProtocolLibrary.getProtocolManager().removePacketListener(windowPacketListener);
|
||||
ProtocolLibrary.getProtocolManager().removePacketListener(chatPacketListener);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onInventoryClick(InventoryClickEvent event) {
|
||||
if (event.getWhoClicked() instanceof Player) {
|
||||
@@ -74,9 +92,8 @@ public class GuiCaptchaHandler implements Listener{
|
||||
event.setCancelled(true);
|
||||
closeReasonMap.put(player, "verified");
|
||||
player.closeInventory();
|
||||
player.sendMessage("§a验证完成");
|
||||
messages.send(player, MessageKey.GUI_CAPTCHA_VERIFIED);
|
||||
}
|
||||
//force to string
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,13 +103,13 @@ public class GuiCaptchaHandler implements Listener{
|
||||
randomString = "";
|
||||
Player playerunreg = event.getPlayer();
|
||||
String name = playerunreg.getName();
|
||||
if (!authmeApi.isRegistered(name)) {
|
||||
if (!authmeApi.isRegistered(name) && !isNpc(playerunreg)) {
|
||||
if (isBedrockPlayer(playerunreg.getUniqueId())) {
|
||||
closeReasonMap.put(playerunreg, "verified");
|
||||
playerunreg.sendMessage("§a基岩版自动验证完成");
|
||||
messages.send(playerunreg, MessageKey.GUI_CAPTCHA_VERIFIED_AUTO_BEDROCK);
|
||||
return;
|
||||
}
|
||||
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
|
||||
bukkitService.runTaskAsynchronously(() -> {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
howLongIsRandomString = (howManyRandom.nextInt(3) + 1);
|
||||
for (int i = 0; i < howLongIsRandomString; i++) {
|
||||
@@ -106,71 +123,66 @@ public class GuiCaptchaHandler implements Listener{
|
||||
sb.append(randomChar);
|
||||
}
|
||||
|
||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||
bukkitService.runTask(() -> {
|
||||
randomString = sb.toString();
|
||||
Random random_blockpos = new Random();
|
||||
AtomicInteger random_num = new AtomicInteger(random_blockpos.nextInt(26));
|
||||
Inventory menu = Bukkit.createInventory(playerunreg, 27, randomString + "请验证你是真人");
|
||||
Inventory menu = Bukkit.createInventory(playerunreg, 27, messages.retrieveSingle(playerunreg, MessageKey.GUI_CAPTCHA_WINDOW_NAME, randomString));
|
||||
ItemStack item = new ItemStack(Material.REDSTONE_BLOCK);
|
||||
ItemMeta meta = item.getItemMeta();
|
||||
try {
|
||||
if (meta != null) {
|
||||
meta.setDisplayName("§a" + randomString + "§a我是真人");
|
||||
meta.setDisplayName(messages.retrieveSingle(playerunreg, MessageKey.GUI_CAPTCHA_CLICKABLE_NAME, randomString));
|
||||
item.setItemMeta(meta);
|
||||
}
|
||||
} catch (NullPointerException e) {
|
||||
getLogger().log(Level.WARNING, "Unexpected error occurred while setting item meta.");
|
||||
}
|
||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||
menu.setItem(random_num.get(), item);
|
||||
});
|
||||
menu.setItem(random_num.get(), item);
|
||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||
playerunreg.openInventory(menu);
|
||||
});
|
||||
playerunreg.openInventory(menu);
|
||||
if (AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) > 0) {
|
||||
long timeOut = AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT);
|
||||
if (AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) > AuthMe.settings.getProperty(RestrictionSettings.TIMEOUT)) {
|
||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||
bukkitService.runTask(() -> {
|
||||
getLogger().warning("AuthMe detected that your GUI captcha timeout seconds(" + AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) + ") is bigger than the Login timeout seconds(" +
|
||||
AuthMe.settings.getProperty(RestrictionSettings.TIMEOUT) + "). To prevent issues, we will let the GUI captcha follow the Login timeout seconds, please check and modify your config.");
|
||||
});
|
||||
timeOut = AuthMe.settings.getProperty(RestrictionSettings.TIMEOUT);
|
||||
}
|
||||
long finalTimeOut = timeOut;
|
||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||
Bukkit.getScheduler().runTaskLater(this.plugin, () -> {
|
||||
bukkitService.runTask(() -> {
|
||||
bukkitService.runTaskLater(() -> {
|
||||
if (!closeReasonMap.containsKey(playerunreg) && !authmeApi.isRegistered(playerunreg.getName())) {
|
||||
playerunreg.kickPlayer("§c验证超时");
|
||||
playerunreg.kickPlayer(service.retrieveSingleMessage(playerunreg, MessageKey.GUI_CAPTCHA_KICK_TIMEOUT));
|
||||
timesLeft = 3; // Reset the attempt counter
|
||||
}
|
||||
}, finalTimeOut * 20L);
|
||||
});
|
||||
}
|
||||
|
||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||
bukkitService.runTask(() -> {
|
||||
windowPacketListener = new PacketAdapter(this.plugin, ListenerPriority.HIGHEST, PacketType.Play.Client.CLOSE_WINDOW) {
|
||||
@Override
|
||||
public void onPacketReceiving(PacketEvent event) {
|
||||
if (event.getPlayer() == playerunreg && !closeReasonMap.containsKey(playerunreg) && !authmeApi.isRegistered(playerunreg.getName())) {
|
||||
if (timesLeft <= 0) {
|
||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||
playerunreg.kickPlayer("§c请先完成人机验证!");
|
||||
bukkitService.runTask(() -> {
|
||||
playerunreg.kickPlayer(service.retrieveSingleMessage(playerunreg, MessageKey.GUI_CAPTCHA_KICK_FAILED));
|
||||
});
|
||||
timesLeft = 3;
|
||||
} else {
|
||||
--timesLeft;
|
||||
if (timesLeft <= 0) {
|
||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||
playerunreg.kickPlayer("§c请先完成人机验证!");
|
||||
bukkitService.runTask(() -> {
|
||||
playerunreg.kickPlayer(service.retrieveSingleMessage(playerunreg, MessageKey.GUI_CAPTCHA_KICK_FAILED));
|
||||
});
|
||||
timesLeft = 3;
|
||||
return;
|
||||
}
|
||||
playerunreg.sendMessage("§c请先完成验证!,你还有" + timesLeft + "次机会");
|
||||
messages.send(playerunreg, MessageKey.GUI_CAPTCHA_RETRY_MESSAGE, String.valueOf(timesLeft));
|
||||
event.setCancelled(true);
|
||||
random_num.set(random_blockpos.nextInt(26));
|
||||
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||
bukkitService.runTask(() -> {
|
||||
menu.clear();
|
||||
menu.setItem(random_num.get(), item);
|
||||
playerunreg.openInventory(menu);
|
||||
@@ -181,12 +193,12 @@ public class GuiCaptchaHandler implements Listener{
|
||||
};
|
||||
ProtocolLibrary.getProtocolManager().addPacketListener(windowPacketListener);
|
||||
});
|
||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
||||
bukkitService.runTask(() -> {
|
||||
chatPacketListener = new PacketAdapter(this.plugin, ListenerPriority.HIGHEST, PacketType.Play.Client.CHAT) {
|
||||
@Override
|
||||
public void onPacketReceiving(PacketEvent event) {
|
||||
if (event.getPlayer() == playerunreg && !closeReasonMap.containsKey(playerunreg) && !authmeApi.isRegistered(playerunreg.getName())) {
|
||||
playerunreg.sendMessage("§c请先完成验证!");
|
||||
messages.send(playerunreg, MessageKey.GUI_CAPTCHA_DENIED_MESSAGE);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
@@ -235,18 +247,16 @@ public class GuiCaptchaHandler implements Listener{
|
||||
if (!authmeApi.isRegistered(name)) {
|
||||
if (AuthMe.settings.getProperty(SecuritySettings.DELETE_UNVERIFIED_PLAYER_DATA) && !closeReasonMap.containsKey(player)) {
|
||||
closeReasonMap.remove(player);
|
||||
Bukkit.getScheduler().runTaskLater(this.plugin, () -> {
|
||||
bukkitService.runTaskLater(() -> {
|
||||
if (!player.isOnline()) {
|
||||
deletePlayerData(playerUUID);
|
||||
deletePlayerStats(playerUUID);
|
||||
}
|
||||
}, 100L);
|
||||
ProtocolLibrary.getProtocolManager().removePacketListener(windowPacketListener);
|
||||
ProtocolLibrary.getProtocolManager().removePacketListener(chatPacketListener);
|
||||
removePacketListeners();
|
||||
return;
|
||||
}
|
||||
ProtocolLibrary.getProtocolManager().removePacketListener(windowPacketListener);
|
||||
ProtocolLibrary.getProtocolManager().removePacketListener(chatPacketListener);
|
||||
removePacketListeners();
|
||||
closeReasonMap.remove(player);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,6 @@ public class LoginLocationFixListener implements Listener {
|
||||
materialPortal = Material.matchMaterial("NETHER_PORTAL");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
||||
@@ -4,13 +4,59 @@ package fr.xephi.authme.message;
|
||||
* Keys for translatable messages managed by {@link Messages}.
|
||||
*/
|
||||
public enum MessageKey {
|
||||
/** In order to use this command you must be authenticated! */
|
||||
/**
|
||||
* %random Verification
|
||||
*/
|
||||
GUI_CAPTCHA_WINDOW_NAME("gui_captcha.captcha_window_name", "%random"),
|
||||
|
||||
/**
|
||||
* %random I am human
|
||||
*/
|
||||
GUI_CAPTCHA_CLICKABLE_NAME("gui_captcha.captcha_clickable_name", "%random"),
|
||||
|
||||
/**
|
||||
* Verification failed, you have %times retries left
|
||||
*/
|
||||
GUI_CAPTCHA_RETRY_MESSAGE("gui_captcha.message_on_retry", "%times"),
|
||||
|
||||
/**
|
||||
* Bedrock verification success!
|
||||
*/
|
||||
GUI_CAPTCHA_VERIFIED_AUTO_BEDROCK("gui_captcha.bedrock_auto_verify_success"),
|
||||
|
||||
/**
|
||||
* Please be verified before chatting!
|
||||
*/
|
||||
GUI_CAPTCHA_DENIED_MESSAGE("gui_captcha.denied_message_sending"),
|
||||
|
||||
/**
|
||||
* Verification timed out!
|
||||
*/
|
||||
GUI_CAPTCHA_KICK_TIMEOUT("gui_captcha.kick_on_timeout"),
|
||||
|
||||
/**
|
||||
* Please complete the verification!
|
||||
*/
|
||||
GUI_CAPTCHA_KICK_FAILED("gui_captcha.kick_on_failed"),
|
||||
|
||||
/**
|
||||
* Verification success!
|
||||
*/
|
||||
GUI_CAPTCHA_VERIFIED("gui_captcha.success"),
|
||||
|
||||
/**
|
||||
* In order to use this command you must be authenticated!
|
||||
*/
|
||||
DENIED_COMMAND("error.denied_command"),
|
||||
|
||||
/** A player with the same IP is already in game! */
|
||||
/**
|
||||
* A player with the same IP is already in game!
|
||||
*/
|
||||
SAME_IP_ONLINE("on_join_validation.same_ip_online"),
|
||||
|
||||
/** In order to chat you must be authenticated! */
|
||||
/**
|
||||
* In order to chat you must be authenticated!
|
||||
*/
|
||||
DENIED_CHAT("error.denied_chat"),
|
||||
|
||||
/** AntiBot protection mode is enabled! You have to wait some minutes before joining the server. */
|
||||
|
||||
@@ -149,6 +149,7 @@ public class MessageUpdater {
|
||||
.put("verification", "Verification code")
|
||||
.put("time", "Time units")
|
||||
.put("two_factor", "Two-factor authentication")
|
||||
.put("gui_captcha", "3rd party features: GUI Captcha")
|
||||
.build();
|
||||
|
||||
Set<String> addedKeys = new HashSet<>();
|
||||
|
||||
@@ -155,3 +155,14 @@ time:
|
||||
hours: 'hours'
|
||||
day: 'day'
|
||||
days: 'days'
|
||||
|
||||
# 3rd party features: GUI Captcha
|
||||
gui_captcha:
|
||||
success: '&aVerification success!'
|
||||
bedrock_auto_verify_success: '&aBedrock verification success!'
|
||||
captcha_window_name: '%random Verification'
|
||||
captcha_clickable_name: '%random I am human'
|
||||
message_on_retry: '&cVerification failed, you have %times retries left'
|
||||
denied_message_sending: '&cPlease be verified before chatting!'
|
||||
kick_on_failed: '&cPlease complete the verification!'
|
||||
kick_on_timeout: '&cVerification timed out!'
|
||||
|
||||
@@ -154,13 +154,24 @@ time:
|
||||
|
||||
# Two-factor authentication
|
||||
two_factor:
|
||||
code_created: '&7您正在激活双重验证, 请打开 &a%url &7扫描二维码'
|
||||
confirmation_required: '&7请输入“/totp confirm <验证码>”来确认激活双重验证'
|
||||
code_required: '&c请输入“/totp code <验证码>”来提交验证码'
|
||||
already_enabled: '&a双重验证已启用'
|
||||
enable_error_no_code: '&c验证码丢失'
|
||||
enable_success: '&a已成功启用双重验证'
|
||||
enable_error_wrong_code: '&c验证码错误或者已经过期,请重新执行“/totp add”'
|
||||
not_enabled_error: '&c双重验证未在您的账号上启用,请使用“/totp add”来启用'
|
||||
removed_success: '&c双重验证已从您的账号上禁用'
|
||||
invalid_code: '&c无效的验证码'
|
||||
code_created: '&7您正在激活双重验证, 请打开 &a%url &7扫描二维码'
|
||||
confirmation_required: '&7请输入“/totp confirm <验证码>”来确认激活双重验证'
|
||||
code_required: '&c请输入“/totp code <验证码>”来提交验证码'
|
||||
already_enabled: '&a双重验证已启用'
|
||||
enable_error_no_code: '&c验证码丢失'
|
||||
enable_success: '&a已成功启用双重验证'
|
||||
enable_error_wrong_code: '&c验证码错误或者已经过期,请重新执行“/totp add”'
|
||||
not_enabled_error: '&c双重验证未在您的账号上启用,请使用“/totp add”来启用'
|
||||
removed_success: '&c双重验证已从您的账号上禁用'
|
||||
invalid_code: '&c无效的验证码'
|
||||
|
||||
# 3rd party features: GUI Captcha
|
||||
gui_captcha:
|
||||
success: '&a*** 验证完成 ***'
|
||||
bedrock_auto_verify_success: '&a*** 基岩版自动验证完成 ***'
|
||||
captcha_window_name: '&k%random&r&n请验证你是真人'
|
||||
captcha_clickable_name: '&k%random&r&n我是真人'
|
||||
message_on_retry: '&c验证失败,你还有 %times 次机会'
|
||||
denied_message_sending: '&c请先完成验证再聊天!'
|
||||
kick_on_failed: '&c请先完成验证!'
|
||||
kick_on_timeout: '&c验证超时'
|
||||
|
||||
@@ -3,7 +3,7 @@ authors: [${pluginDescription.authors}]
|
||||
website: http://github.com/HaHaWTH/AuthMeReReloaded/
|
||||
description: A fork of AuthMeReloaded that contains bug fixes
|
||||
main: ${pluginDescription.main}
|
||||
version: 5.6.0-FORK-b30
|
||||
version: 5.6.0-FORK-b31
|
||||
api-version: 1.13
|
||||
softdepend:
|
||||
- Vault
|
||||
|
||||
Reference in New Issue
Block a user