debug & update

This commit is contained in:
HaHaWTH 2023-10-22 14:13:28 +08:00
parent 19866bc4a4
commit 72073b80f0
3 changed files with 29 additions and 19 deletions

View File

@ -784,7 +784,13 @@
<optional>true</optional> <optional>true</optional>
</dependency> </dependency>
<!-- Bukkit Libraries --> <!-- FastUtil -->
<!-- <dependency>-->
<!-- <groupId>it.unimi.dsi</groupId>-->
<!-- <artifactId>fastutil-core</artifactId>-->
<!-- <version>8.5.12</version>-->
<!-- <scope>provided</scope>-->
<!-- </dependency>-->
<!-- ConfigMe --> <!-- ConfigMe -->
<dependency> <dependency>

View File

@ -208,33 +208,38 @@ public class AuthMe extends JavaPlugin {
purgeService.runAutoPurge(); purgeService.runAutoPurge();
// 注册玩家加入事件监听 // 注册玩家加入事件监听
// if (settings.getProperty(SecuritySettings.ANTI_GHOST_PLAYERS) || settings.getProperty(SecuritySettings.SMART_ASYNC_TELEPORT)/* || settings.getProperty(SecuritySettings.GUI_CAPTCHA)*/) { // if (settings.getProperty(SecuritySettings.ANTI_GHOST_PLAYERS) || settings.getProperty(SecuritySettings.SMART_ASYNC_TELEPORT)/* || settings.getProperty(SecuritySettings.GUI_CAPTCHA)*/) {
if (settings.getProperty(SecuritySettings.ANTI_GHOST_PLAYERS)) { register3rdPartyListeners();
getServer().getPluginManager().registerEvents(new DoubleLoginFixListener((Plugin) this), this);
}
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().isPluginEnabled("floodgate")) {
getServer().getPluginManager().registerEvents(new BedrockAutoLoginListener((Plugin) this), this);
}
if (settings.getProperty(SecuritySettings.GUI_CAPTCHA) && getServer().getPluginManager().isPluginEnabled("ProtocolLib")) {
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().isPluginEnabled("ProtocolLib")) {
logger.warning("ProtocolLib is not loaded, we can't enable GUI Captcha.");
}
logger.info("GitHub: https://github.com/HaHaWTH/AuthMeReReloaded/"); logger.info("GitHub: https://github.com/HaHaWTH/AuthMeReReloaded/");
if (settings.getProperty(SecuritySettings.CHECK_FOR_UPDATES)) { if (settings.getProperty(SecuritySettings.CHECK_FOR_UPDATES)) {
checkForUpdates(); checkForUpdates();
} }
if (SHAEnabled){ if (SHAEnabled) {
//shaChecker(); //shaChecker();
} }
} }
public File pluginfile = getFile(); public File pluginfile = getFile();
private void register3rdPartyListeners() {
if (settings.getProperty(SecuritySettings.ANTI_GHOST_PLAYERS)) {
getServer().getPluginManager().registerEvents(new DoubleLoginFixListener((Plugin) this), this);
}
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.");
}
}
/** /**
* Load the version and build number of the plugin from the description file. * Load the version and build number of the plugin from the description file.
* *

View File

@ -38,7 +38,6 @@ public class GuiCaptchaHandler implements Listener{
private final AuthMeApi authmeApi = AuthMeApi.getInstance(); private final AuthMeApi authmeApi = AuthMeApi.getInstance();
private final Plugin plugin; private final Plugin plugin;
private PacketAdapter chatPacketListener; private PacketAdapter chatPacketListener;
private PacketAdapter windowPacketListener; private PacketAdapter windowPacketListener;
//define timesLeft //define timesLeft
private int timesLeft = 3; private int timesLeft = 3;