Compare commits
115 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 23306d1f5c | |||
| fc546ac87a | |||
| 764b2788ae | |||
| d1fc832d2d | |||
| c170c70639 | |||
| 8db8d0f6da | |||
| 6b5e0b82ba | |||
| 265ea66894 | |||
| b1b4bb0a79 | |||
| fa7ce8bfb4 | |||
| 78369644c7 | |||
| 22b8b6bf64 | |||
| fcec8e41a2 | |||
| ee24cabbed | |||
| eed1c5aedc | |||
| 1f88b3bc12 | |||
| 5cd8791fee | |||
| 787e04488b | |||
| 2accd9592c | |||
| 66bfbbbdb1 | |||
| cb195fd1ca | |||
| a1ef28095f | |||
| 77b40cc1e8 | |||
| 4c52484fd7 | |||
| 5b72708167 | |||
| b69e931c44 | |||
| 213b1c2702 | |||
| 0fef595229 | |||
| 791d1f1872 | |||
| ef92c776af | |||
| 66cf0143f6 | |||
| 3ff3b0d294 | |||
| b9ecb58760 | |||
| a8e55b4ae3 | |||
| 657e51f2cc | |||
| ff16f91311 | |||
| d05d4971b5 | |||
| 5f58e92666 | |||
| a31c2f45b1 | |||
| 06d9e71ae8 | |||
| 441e020192 | |||
| f153867d85 | |||
| eed5ce1b7b | |||
| 00b4bcb6a3 | |||
| e69ba501da | |||
| f2ccbf72a8 | |||
| c29aec210b | |||
| 78b5102692 | |||
| 9fd671db85 | |||
| beb99418d4 | |||
| 0f70de9a5a | |||
| 08ad55c742 | |||
| a70c1e0102 | |||
| efec997128 | |||
| 413c2a39d7 | |||
| 5a9b9ce619 | |||
| ee58da2b39 | |||
| 7475cd8ea4 | |||
| 8b8f6c0e2e | |||
| 69b170b754 | |||
| 702b6aae32 | |||
| 010874586a | |||
| fcc34c28aa | |||
| ecbc11cf0b | |||
| bfd3a8f439 | |||
| f8dd410d96 | |||
| 2459aec4b6 | |||
| d623337a15 | |||
| 73c3cea778 | |||
| 11a4cff10a | |||
| 628d5adcb5 | |||
| 8681cd0733 | |||
| bb2fdbfb40 | |||
| 4dedc30d94 | |||
| fa995eea53 | |||
| e819be918b | |||
| 1e3e625c1a | |||
| b747a4bdff | |||
| 03443104be | |||
| 819e55e235 | |||
| 80b06f3bc7 | |||
| d90e87896c | |||
| 72073b80f0 | |||
| 19866bc4a4 | |||
| cf4037614a | |||
| 5c22601c52 | |||
| 1bb3bb1fa7 | |||
| 11959ca794 | |||
| 9ba9af6369 | |||
| 584f2074fd | |||
| 2971a0a202 | |||
| 3cc8128faa | |||
| 1ef7ed4b3f | |||
| 59eabe38c6 | |||
| 1c090a5a65 | |||
| 82fade61d5 | |||
| fc5009bf0d | |||
| 9fe91fe22c | |||
| 37d327bcb6 | |||
| 217b411095 | |||
| 9239f3a90d | |||
| ae9d9ea159 | |||
| 12cfd243f6 | |||
| 059c00c2ad | |||
| 3dab24c142 | |||
| 4de55f9cf6 | |||
| 07d9bbbf7c | |||
| c182510a46 | |||
| aec1277ab3 | |||
| 32b694cbb0 | |||
| 932368f2d6 | |||
| 7a33fc8928 | |||
| d048db44ba | |||
| 76b92bacd9 | |||
| dadae42992 |
@@ -19,5 +19,10 @@ jobs:
|
|||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: ${{ matrix.jdkversion }}
|
java-version: ${{ matrix.jdkversion }}
|
||||||
cache: 'maven'
|
cache: 'maven'
|
||||||
- name: 使用Maven构建
|
- name: Build
|
||||||
run: mvn -V -B clean package --file pom.xml
|
run: mvn -V -B clean package --file pom.xml
|
||||||
|
- name: Upload Artifacts
|
||||||
|
uses: actions/upload-artifact@v3.1.2
|
||||||
|
with:
|
||||||
|
name: Download
|
||||||
|
path: ./target/AuthMe-5.6.0-FORK-Spigot-Universal.jar
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
**"A fork of the best authentication plugin for the Bukkit modding API!"**
|
**"A fork of the best authentication plugin for the Bukkit modding API!"**
|
||||||
MCBBS Link: [Click Here](https://www.mcbbs.net/forum.php?mod=viewthread&tid=1471495)
|
MCBBS Link: [Click Here](https://www.mcbbs.net/forum.php?mod=viewthread&tid=1471495)
|
||||||

|

|
||||||
|
<p align="center">
|
||||||
|
<img src="https://img.shields.io/github/languages/code-size/HaHaWTH/AuthMeReReloaded.svg" alt="Code size"/>
|
||||||
|
<img src="https://img.shields.io/github/repo-size/HaHaWTH/AuthMeReReloaded.svg" alt="GitHub repo size"/>
|
||||||
|
</p>
|
||||||
|
|
||||||
**Detailed Changes:**
|
**Detailed Changes:**
|
||||||
1. Improved mail sending logic & support more emails
|
1. Improved mail sending logic & support more emails
|
||||||
@@ -9,13 +13,20 @@ MCBBS Link: [Click Here](https://www.mcbbs.net/forum.php?mod=viewthread&tid=1471
|
|||||||
3. Old bug fixes
|
3. Old bug fixes
|
||||||
4. Anti Ghost Player(Doubled login bug)
|
4. Anti Ghost Player(Doubled login bug)
|
||||||
5. Use the best performance method by server brand
|
5. Use the best performance method by server brand
|
||||||
6. Bedrock Compatibility(Floodgate needed)
|
6. Bedrock Compatibility(Floodgate needed)(based on UUID)
|
||||||
7. Update checker
|
7. Update checker
|
||||||
8. Integrated GUI Captcha feature(Bedrock compatibility & ProtocolLib needed)(70% Asynchronous)
|
8. Integrated GUI Captcha feature(Bedrock compatibility & ProtocolLib needed)(70% Asynchronous)
|
||||||
9. Improved listeners
|
9. Improved listeners
|
||||||
10. Player login logic improvement to reduce lag
|
10. Player login logic improvement to reduce lag
|
||||||
11. Automatically purge bot data
|
11. Automatically purge bot data
|
||||||
12. Folia compatibility [Here](https://github.com/HaHaWTH/AuthMeReReloaded/releases/download/b20/AuthMe-5.6.0-FORK-Folia.jar)
|
12. Folia
|
||||||
|
compatibility [Here](https://github.com/HaHaWTH/AuthMeReReloaded/releases/download/b20/AuthMe-5.6.0-FORK-Folia.jar)
|
||||||
13. Offhand Menu compatibility(Thats amazing)
|
13. Offhand Menu compatibility(Thats amazing)
|
||||||
14. Automatically fix portal stuck issue
|
14. Automatically fix portal stuck issue
|
||||||
15. More......
|
15. More......
|
||||||
|
|
||||||
|
**Download links:**
|
||||||
|
[Releases](https://github.com/HaHaWTH/AuthMeReReloaded/releases/latest)
|
||||||
|
[Actions(Dev builds, use at your own risk!)](https://github.com/HaHaWTH/AuthMeReReloaded/actions/workflows/maven.yml)
|
||||||
|
|
||||||
|
**Pull Requests and suggestions are welcome!**
|
||||||
|
|||||||
@@ -67,11 +67,11 @@
|
|||||||
<maven.minimumVersion>3.6.3</maven.minimumVersion>
|
<maven.minimumVersion>3.6.3</maven.minimumVersion>
|
||||||
|
|
||||||
<!-- Dependencies versions -->
|
<!-- Dependencies versions -->
|
||||||
<spigot.version>1.20.1-R0.1-SNAPSHOT</spigot.version>
|
<spigot.version>1.20.2-R0.1-SNAPSHOT</spigot.version>
|
||||||
|
|
||||||
<!-- Versioning properties -->
|
<!-- Versioning properties -->
|
||||||
<project.outputName>AuthMe</project.outputName>
|
<project.outputName>AuthMe</project.outputName>
|
||||||
<project.buildNumber>CUSTOM</project.buildNumber>
|
<project.buildNumber>28</project.buildNumber>
|
||||||
<project.versionCode>${project.version}-b${project.buildNumber}</project.versionCode>
|
<project.versionCode>${project.version}-b${project.buildNumber}</project.versionCode>
|
||||||
<project.finalNameBase>${project.outputName}-${project.version}</project.finalNameBase>
|
<project.finalNameBase>${project.outputName}-${project.version}</project.finalNameBase>
|
||||||
|
|
||||||
@@ -598,6 +598,11 @@
|
|||||||
<enabled>true</enabled>
|
<enabled>true</enabled>
|
||||||
</snapshots>
|
</snapshots>
|
||||||
</repository>
|
</repository>
|
||||||
|
<!-- FoliaLib -->
|
||||||
|
<repository>
|
||||||
|
<id>devmart-other</id>
|
||||||
|
<url>https://nexuslite.gcnt.net/repos/other/</url>
|
||||||
|
</repository>
|
||||||
<repository>
|
<repository>
|
||||||
<id>opencollab-snapshot</id>
|
<id>opencollab-snapshot</id>
|
||||||
<url>https://repo.opencollab.dev/maven-snapshots/</url>
|
<url>https://repo.opencollab.dev/maven-snapshots/</url>
|
||||||
@@ -687,7 +692,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.zaxxer</groupId>
|
<groupId>com.zaxxer</groupId>
|
||||||
<artifactId>HikariCP</artifactId>
|
<artifactId>HikariCP</artifactId>
|
||||||
<version>5.0.1</version> <!-- Latest java 8 release -->
|
<version>4.0.3</version> <!-- Latest java 8 release -->
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
@@ -700,7 +705,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-simple</artifactId>
|
<artifactId>slf4j-simple</artifactId>
|
||||||
<version>2.0.5</version> <!-- We can't update to 2.x as long as we use HikariCP for java 8 -->
|
<version>1.7.36</version> <!-- We can't update to 2.x as long as we use HikariCP for java 8 -->
|
||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@@ -784,8 +789,6 @@
|
|||||||
<optional>true</optional>
|
<optional>true</optional>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Bukkit Libraries -->
|
|
||||||
|
|
||||||
<!-- ConfigMe -->
|
<!-- ConfigMe -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>ch.jalu</groupId>
|
<groupId>ch.jalu</groupId>
|
||||||
@@ -1070,7 +1073,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.checkerframework</groupId>
|
<groupId>org.checkerframework</groupId>
|
||||||
<artifactId>checker-qual</artifactId>
|
<artifactId>checker-qual</artifactId>
|
||||||
<version>3.39.0</version>
|
<version>3.40.0</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@@ -1078,7 +1081,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.xerial</groupId>
|
<groupId>org.xerial</groupId>
|
||||||
<artifactId>sqlite-jdbc</artifactId>
|
<artifactId>sqlite-jdbc</artifactId>
|
||||||
<version>3.40.1.0</version>
|
<version>3.44.0.0</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -9,22 +9,18 @@ import fr.xephi.authme.initialization.DataFolder;
|
|||||||
import fr.xephi.authme.initialization.DataSourceProvider;
|
import fr.xephi.authme.initialization.DataSourceProvider;
|
||||||
import fr.xephi.authme.initialization.OnShutdownPlayerSaver;
|
import fr.xephi.authme.initialization.OnShutdownPlayerSaver;
|
||||||
import fr.xephi.authme.initialization.OnStartupTasks;
|
import fr.xephi.authme.initialization.OnStartupTasks;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.HttpURLConnection;
|
|
||||||
|
|
||||||
import fr.xephi.authme.initialization.SettingsProvider;
|
import fr.xephi.authme.initialization.SettingsProvider;
|
||||||
import fr.xephi.authme.initialization.TaskCloser;
|
import fr.xephi.authme.initialization.TaskCloser;
|
||||||
|
import fr.xephi.authme.listener.BedrockAutoLoginListener;
|
||||||
import fr.xephi.authme.listener.BlockListener;
|
import fr.xephi.authme.listener.BlockListener;
|
||||||
|
import fr.xephi.authme.listener.DoubleLoginFixListener;
|
||||||
import fr.xephi.authme.listener.EntityListener;
|
import fr.xephi.authme.listener.EntityListener;
|
||||||
|
import fr.xephi.authme.listener.GuiCaptchaHandler;
|
||||||
import fr.xephi.authme.listener.LoginLocationFixListener;
|
import fr.xephi.authme.listener.LoginLocationFixListener;
|
||||||
import fr.xephi.authme.listener.PlayerListener;
|
import fr.xephi.authme.listener.PlayerListener;
|
||||||
import fr.xephi.authme.listener.PlayerListener111;
|
import fr.xephi.authme.listener.PlayerListener111;
|
||||||
import fr.xephi.authme.listener.PlayerListener19;
|
import fr.xephi.authme.listener.PlayerListener19;
|
||||||
import fr.xephi.authme.listener.PlayerListener19Spigot;
|
import fr.xephi.authme.listener.PlayerListener19Spigot;
|
||||||
import fr.xephi.authme.listener.DoubleLoginFixListener;
|
|
||||||
import fr.xephi.authme.listener.GuiCaptchaHandler;
|
|
||||||
import fr.xephi.authme.listener.PlayerListenerHigherThan18;
|
import fr.xephi.authme.listener.PlayerListenerHigherThan18;
|
||||||
import fr.xephi.authme.listener.ServerListener;
|
import fr.xephi.authme.listener.ServerListener;
|
||||||
import fr.xephi.authme.mail.EmailService;
|
import fr.xephi.authme.mail.EmailService;
|
||||||
@@ -38,21 +34,23 @@ import fr.xephi.authme.service.yaml.YamlParseException;
|
|||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.settings.SettingsWarner;
|
import fr.xephi.authme.settings.SettingsWarner;
|
||||||
import fr.xephi.authme.settings.properties.EmailSettings;
|
import fr.xephi.authme.settings.properties.EmailSettings;
|
||||||
|
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||||
import fr.xephi.authme.task.CleanupTask;
|
import fr.xephi.authme.task.CleanupTask;
|
||||||
import fr.xephi.authme.task.purge.PurgeService;
|
import fr.xephi.authme.task.purge.PurgeService;
|
||||||
import fr.xephi.authme.util.ExceptionUtils;
|
import fr.xephi.authme.util.ExceptionUtils;
|
||||||
import org.bukkit.Bukkit;
|
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
import org.bukkit.plugin.PluginManager;
|
import org.bukkit.plugin.PluginManager;
|
||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
import org.bukkit.scheduler.BukkitScheduler;
|
import org.bukkit.scheduler.BukkitScheduler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -76,8 +74,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
// Version and build number values
|
// Version and build number values
|
||||||
private static String pluginVersion = "5.6.0-Fork";
|
private static String pluginVersion = "5.6.0-Fork";
|
||||||
private static final String pluginBuild = "b";
|
private static final String pluginBuild = "b";
|
||||||
private static String pluginBuildNumber = "27";
|
private static String pluginBuildNumber = "34";
|
||||||
protected final Boolean SHAEnabled = false;
|
|
||||||
// Private instances
|
// Private instances
|
||||||
private EmailService emailService;
|
private EmailService emailService;
|
||||||
private CommandHandler commandHandler;
|
private CommandHandler commandHandler;
|
||||||
@@ -123,6 +120,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method called when the server enables the plugin.
|
* Method called when the server enables the plugin.
|
||||||
*/
|
*/
|
||||||
@@ -178,7 +176,6 @@ public class AuthMe extends JavaPlugin {
|
|||||||
cleanupTask.runTaskTimerAsynchronously(this, CLEANUP_INTERVAL, CLEANUP_INTERVAL);
|
cleanupTask.runTaskTimerAsynchronously(this, CLEANUP_INTERVAL, CLEANUP_INTERVAL);
|
||||||
// Do a backup on start
|
// Do a backup on start
|
||||||
backupService.doBackup(BackupService.BackupCause.START);
|
backupService.doBackup(BackupService.BackupCause.START);
|
||||||
|
|
||||||
// Set up Metrics
|
// Set up Metrics
|
||||||
OnStartupTasks.sendMetrics(this, settings);
|
OnStartupTasks.sendMetrics(this, settings);
|
||||||
if(settings.getProperty(SecuritySettings.SHOW_STARTUP_BANNER)) {
|
if(settings.getProperty(SecuritySettings.SHOW_STARTUP_BANNER)) {
|
||||||
@@ -207,31 +204,17 @@ public class AuthMe extends JavaPlugin {
|
|||||||
PurgeService purgeService = injector.getSingleton(PurgeService.class);
|
PurgeService purgeService = injector.getSingleton(PurgeService.class);
|
||||||
purgeService.runAutoPurge();
|
purgeService.runAutoPurge();
|
||||||
// 注册玩家加入事件监听
|
// 注册玩家加入事件监听
|
||||||
// if (settings.getProperty(SecuritySettings.ANTI_GHOST_PLAYERS) || settings.getProperty(SecuritySettings.SMART_ASYNC_TELEPORT)/* || settings.getProperty(SecuritySettings.GUI_CAPTCHA)*/) {
|
// register3rdPartyListeners();
|
||||||
if (settings.getProperty(SecuritySettings.ANTI_GHOST_PLAYERS)) {
|
|
||||||
getServer().getPluginManager().registerEvents(new DoubleLoginFixListener((Plugin) this), this);
|
|
||||||
}
|
|
||||||
if (settings.getProperty(SecuritySettings.LOGIN_LOC_FIX)) {
|
|
||||||
getServer().getPluginManager().registerEvents(new LoginLocationFixListener((Plugin) this), this);
|
|
||||||
}
|
|
||||||
if (settings.getProperty(SecuritySettings.GUI_CAPTCHA) && getServer().getPluginManager().isPluginEnabled("ProtocolLib")) {
|
|
||||||
getServer().getPluginManager().registerEvents(new GuiCaptchaHandler((Plugin) this), this);
|
|
||||||
logger.info("(Alpha4)GUICaptcha Feature is enabled successfully!");
|
|
||||||
logger.info("These features are still in 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();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Migrated
|
||||||
|
|
||||||
if (SHAEnabled){
|
|
||||||
//shaChecker();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public File pluginfile = getFile();
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
*
|
*
|
||||||
@@ -326,13 +309,13 @@ public class AuthMe extends JavaPlugin {
|
|||||||
pluginManager.registerEvents(injector.getSingleton(EntityListener.class), this);
|
pluginManager.registerEvents(injector.getSingleton(EntityListener.class), this);
|
||||||
pluginManager.registerEvents(injector.getSingleton(ServerListener.class), this);
|
pluginManager.registerEvents(injector.getSingleton(ServerListener.class), this);
|
||||||
|
|
||||||
|
|
||||||
// Try to register 1.8+ player listeners
|
// 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);
|
pluginManager.registerEvents(injector.getSingleton(PlayerListenerHigherThan18.class), this);
|
||||||
} else if (isClassLoaded("org.bukkit.event.player.PlayerSwapHandItemsEvent")) {
|
} else if (isClassLoaded("org.bukkit.event.player.PlayerSwapHandItemsEvent")) {
|
||||||
pluginManager.registerEvents(injector.getSingleton(PlayerListener19.class), this);
|
pluginManager.registerEvents(injector.getSingleton(PlayerListener19.class), this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try to register 1.9 player listeners(Moved to else-if)
|
// Try to register 1.9 player listeners(Moved to else-if)
|
||||||
// if (isClassLoaded("org.bukkit.event.player.PlayerSwapHandItemsEvent")) {
|
// if (isClassLoaded("org.bukkit.event.player.PlayerSwapHandItemsEvent")) {
|
||||||
// pluginManager.registerEvents(injector.getSingleton(PlayerListener19.class), this);
|
// pluginManager.registerEvents(injector.getSingleton(PlayerListener19.class), this);
|
||||||
@@ -347,6 +330,26 @@ public class AuthMe extends JavaPlugin {
|
|||||||
if (isClassLoaded("org.bukkit.event.entity.EntityAirChangeEvent")) {
|
if (isClassLoaded("org.bukkit.event.entity.EntityAirChangeEvent")) {
|
||||||
pluginManager.registerEvents(injector.getSingleton(PlayerListener111.class), this);
|
pluginManager.registerEvents(injector.getSingleton(PlayerListener111.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);
|
||||||
|
} else if (settings.getProperty(SecuritySettings.FORCE_LOGIN_BEDROCK) && (!settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) || getServer().getPluginManager().getPlugin("floodgate") == null)) {
|
||||||
|
logger.warning("Failed to enable BedrockAutoLogin, ensure hookFloodgate: true and floodgate is loaded.");
|
||||||
|
}
|
||||||
|
if (settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_UNDERGROUND) || settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_PORTAL)) {
|
||||||
|
pluginManager.registerEvents(injector.getSingleton(LoginLocationFixListener.class), this);
|
||||||
|
}
|
||||||
|
if (settings.getProperty(SecuritySettings.ANTI_GHOST_PLAYERS)) {
|
||||||
|
pluginManager.registerEvents(injector.getSingleton(DoubleLoginFixListener.class), this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -392,12 +395,12 @@ public class AuthMe extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static final String owner = "HaHaWTH";
|
private static final String owner = "HaHaWTH";
|
||||||
private static final String owner_gitee = "Shixuehan114514";
|
// private static final String owner_gitee = "Shixuehan114514";
|
||||||
private static final String repo = "AuthMeReReloaded";
|
private static final String repo = "AuthMeReReloaded";
|
||||||
|
|
||||||
private void checkForUpdates() {
|
private void checkForUpdates() {
|
||||||
logger.info("Checking for updates...");
|
logger.info("Checking for updates...");
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(this, () -> {
|
bukkitService.runTaskAsynchronously(() -> {
|
||||||
try {
|
try {
|
||||||
// 从南通集线器获取最新版本号
|
// 从南通集线器获取最新版本号
|
||||||
URL url = new URL("https://api.github.com/repos/" + owner + "/" + repo + "/releases/latest");
|
URL url = new URL("https://api.github.com/repos/" + owner + "/" + repo + "/releases/latest");
|
||||||
@@ -413,13 +416,14 @@ public class AuthMe extends JavaPlugin {
|
|||||||
latestVersion = latestVersion.substring(0, latestVersion.indexOf("\""));
|
latestVersion = latestVersion.substring(0, latestVersion.indexOf("\""));
|
||||||
if (isUpdateAvailable(latestVersion)) {
|
if (isUpdateAvailable(latestVersion)) {
|
||||||
String message = "New version available! Latest:" + latestVersion + " Current:" + pluginBuild + pluginBuildNumber;
|
String message = "New version available! Latest:" + latestVersion + " Current:" + pluginBuild + pluginBuildNumber;
|
||||||
getLogger().log(Level.INFO, message);
|
getLogger().log(Level.WARNING, message);
|
||||||
getLogger().log(Level.INFO, "Download from here: github.com/HaHaWTH/AuthMeReReloaded/releases/latest");
|
getLogger().log(Level.WARNING, "Download from here: github.com/HaHaWTH/AuthMeReReloaded/releases/latest");
|
||||||
} else {
|
} else {
|
||||||
getLogger().log(Level.INFO, "You are running the latest version.");
|
getLogger().log(Level.INFO, "You are running the latest version.");
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} 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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -456,72 +460,6 @@ public class AuthMe extends JavaPlugin {
|
|||||||
logger.info("AuthMeReReloaded is running on Unknown*");
|
logger.info("AuthMeReReloaded is running on Unknown*");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 其他方法和事件处理
|
|
||||||
|
|
||||||
|
|
||||||
// 其他方法和事件处理
|
|
||||||
private static final String SHA_URL = "https://raw.githubusercontent.com/"+ owner +"/"+ repo + "/master/"+pluginBuild +pluginBuildNumber+ ".sha";
|
|
||||||
private static final String ALGORITHM = "SHA-256";
|
|
||||||
private static final String PROXY_URL = "https://ghproxy.com/";
|
|
||||||
private static final String SHA_URL_GITEE = "https://gitee.com/"+ owner_gitee +"/"+ repo + "/raw/master/"+pluginBuild+pluginBuildNumber+ ".sha";
|
|
||||||
|
|
||||||
// public void shaChecker() {
|
|
||||||
// // 请求SHA文件
|
|
||||||
//
|
|
||||||
// String actualSha;
|
|
||||||
// try {
|
|
||||||
// URL url;
|
|
||||||
// if(settings.getProperty(SecuritySettings.SHA_CHECK_METHOD).equals("github")) {
|
|
||||||
// url = new URL(SHA_URL);
|
|
||||||
// logger.info("正在检查文件完整性...(GitHub)");
|
|
||||||
// } else if(settings.getProperty(SecuritySettings.SHA_CHECK_METHOD).equals("ghproxy")) {
|
|
||||||
// url = new URL(PROXY_URL + SHA_URL);
|
|
||||||
// logger.info("正在检查文件完整性...(GhProxy)");
|
|
||||||
// } else if (settings.getProperty(SecuritySettings.SHA_CHECK_METHOD).equals("gitee")) {
|
|
||||||
// url = new URL(SHA_URL_GITEE);
|
|
||||||
// logger.info("正在检查文件完整性...(Gitee)");
|
|
||||||
// }else {
|
|
||||||
// logger.warning("未知的SHA检查方法,将从GitHub获取SHA文件");
|
|
||||||
// url = new URL(SHA_URL);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|
|
||||||
// conn.setConnectTimeout(10000);
|
|
||||||
// conn.setReadTimeout(9000);
|
|
||||||
// conn.setRequestMethod("GET");
|
|
||||||
// InputStream stream = conn.getInputStream();
|
|
||||||
// ByteArrayOutputStream result = new ByteArrayOutputStream();
|
|
||||||
// byte[] buffer = new byte[1024];
|
|
||||||
// int length;
|
|
||||||
// while ((length = stream.read(buffer)) != -1) {
|
|
||||||
// result.write(buffer, 0, length);
|
|
||||||
// }
|
|
||||||
// String expectedSha = result.toString().trim();
|
|
||||||
// // 计算插件文件的SHA值
|
|
||||||
// MessageDigest md = MessageDigest.getInstance(ALGORITHM);
|
|
||||||
// byte[] fileBytes = Files.readAllBytes(pluginfile.toPath());
|
|
||||||
// byte[] hashBytes = md.digest(fileBytes);
|
|
||||||
// StringBuilder sb = new StringBuilder();
|
|
||||||
// for (byte b : hashBytes) {
|
|
||||||
// sb.append(String.format("%02x", b));
|
|
||||||
// }
|
|
||||||
// actualSha = sb.toString();
|
|
||||||
//
|
|
||||||
// // 比较SHA值并加载插件
|
|
||||||
// if (expectedSha.equals(actualSha)) {
|
|
||||||
// logger.info("SHA联网安全校验完毕");
|
|
||||||
// } else {
|
|
||||||
// // SHA值不匹配,插件可能被篡改
|
|
||||||
// logger.warning("SHA值不匹配,插件被篡改");
|
|
||||||
// stopOrUnload();
|
|
||||||
// }
|
|
||||||
// }catch (NoSuchAlgorithmException | IOException e){
|
|
||||||
// logger.warning("SHA校验失败,请尝试切换校验API");
|
|
||||||
// logger.warning("您当前请求的API为:" + settings.getProperty(SecuritySettings.SHA_CHECK_METHOD));
|
|
||||||
// stopOrUnload();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ package fr.xephi.authme.datasource;
|
|||||||
* DataSource type.
|
* DataSource type.
|
||||||
*/
|
*/
|
||||||
public enum DataSourceType {
|
public enum DataSourceType {
|
||||||
|
// H2,
|
||||||
|
|
||||||
MYSQL,
|
MYSQL,
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,408 @@
|
|||||||
|
//package fr.xephi.authme.datasource;
|
||||||
|
//
|
||||||
|
//import com.google.common.annotations.VisibleForTesting;
|
||||||
|
//import fr.xephi.authme.ConsoleLogger;
|
||||||
|
//import fr.xephi.authme.data.auth.PlayerAuth;
|
||||||
|
//import fr.xephi.authme.datasource.columnshandler.AuthMeColumnsHandler;
|
||||||
|
//import fr.xephi.authme.output.ConsoleLoggerFactory;
|
||||||
|
//import fr.xephi.authme.settings.Settings;
|
||||||
|
//import fr.xephi.authme.settings.properties.DatabaseSettings;
|
||||||
|
//
|
||||||
|
//import java.io.File;
|
||||||
|
//import java.sql.Connection;
|
||||||
|
//import java.sql.DatabaseMetaData;
|
||||||
|
//import java.sql.DriverManager;
|
||||||
|
//import java.sql.PreparedStatement;
|
||||||
|
//import java.sql.ResultSet;
|
||||||
|
//import java.sql.SQLException;
|
||||||
|
//import java.sql.Statement;
|
||||||
|
//import java.util.ArrayList;
|
||||||
|
//import java.util.Collection;
|
||||||
|
//import java.util.HashSet;
|
||||||
|
//import java.util.List;
|
||||||
|
//import java.util.Locale;
|
||||||
|
//import java.util.Set;
|
||||||
|
//
|
||||||
|
//import static fr.xephi.authme.datasource.SqlDataSourceUtils.getNullableLong;
|
||||||
|
//import static fr.xephi.authme.datasource.SqlDataSourceUtils.logSqlException;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * H2 data source.
|
||||||
|
// */
|
||||||
|
//@SuppressWarnings({"checkstyle:AbbreviationAsWordInName"}) // Justification: Class name cannot be changed anymore
|
||||||
|
//public class H2 extends AbstractSqlDataSource {
|
||||||
|
//
|
||||||
|
// private final ConsoleLogger logger = ConsoleLoggerFactory.get(H2.class);
|
||||||
|
// private final Settings settings;
|
||||||
|
// private final File dataFolder;
|
||||||
|
// private final String database;
|
||||||
|
// private final String tableName;
|
||||||
|
// private final Columns col;
|
||||||
|
// private Connection con;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * Constructor for H2.
|
||||||
|
// *
|
||||||
|
// * @param settings The settings instance
|
||||||
|
// * @param dataFolder The data folder
|
||||||
|
// * @throws SQLException when initialization of a SQL datasource failed
|
||||||
|
// */
|
||||||
|
// public H2(Settings settings, File dataFolder) throws SQLException {
|
||||||
|
// this.settings = settings;
|
||||||
|
// this.dataFolder = dataFolder;
|
||||||
|
// this.database = settings.getProperty(DatabaseSettings.MYSQL_DATABASE);
|
||||||
|
// this.tableName = settings.getProperty(DatabaseSettings.MYSQL_TABLE);
|
||||||
|
// this.col = new Columns(settings);
|
||||||
|
//
|
||||||
|
// try {
|
||||||
|
// this.connect();
|
||||||
|
// this.setup();
|
||||||
|
// } catch (Exception ex) {
|
||||||
|
// logger.logException("Error during H2 initialization:", ex);
|
||||||
|
// throw ex;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @VisibleForTesting
|
||||||
|
// H2(Settings settings, File dataFolder, Connection connection) {
|
||||||
|
// this.settings = settings;
|
||||||
|
// this.dataFolder = dataFolder;
|
||||||
|
// this.database = settings.getProperty(DatabaseSettings.MYSQL_DATABASE);
|
||||||
|
// this.tableName = settings.getProperty(DatabaseSettings.MYSQL_TABLE);
|
||||||
|
// this.col = new Columns(settings);
|
||||||
|
// this.con = connection;
|
||||||
|
// this.columnsHandler = AuthMeColumnsHandler.createForSqlite(con, settings);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * Initializes the connection to the H2 database.
|
||||||
|
// *
|
||||||
|
// * @throws SQLException when an SQL error occurs while connecting
|
||||||
|
// */
|
||||||
|
// protected void connect() throws SQLException {
|
||||||
|
// try {
|
||||||
|
// Class.forName("org.h2.Driver");
|
||||||
|
// } catch (ClassNotFoundException e) {
|
||||||
|
// throw new IllegalStateException("Failed to load H2 JDBC class", e);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// logger.debug("H2 driver loaded");
|
||||||
|
// this.con = DriverManager.getConnection(this.getJdbcUrl(this.dataFolder.getAbsolutePath(), "", this.database));
|
||||||
|
// this.columnsHandler = AuthMeColumnsHandler.createForSqlite(con, settings);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * Creates the table if necessary, or adds any missing columns to the table.
|
||||||
|
// *
|
||||||
|
// * @throws SQLException when an SQL error occurs while initializing the database
|
||||||
|
// */
|
||||||
|
// @VisibleForTesting
|
||||||
|
// @SuppressWarnings("checkstyle:CyclomaticComplexity")
|
||||||
|
// protected void setup() throws SQLException {
|
||||||
|
// try (Statement st = con.createStatement()) {
|
||||||
|
// // Note: cannot add unique fields later on in SQLite, so we add it on initialization
|
||||||
|
// st.executeUpdate("CREATE TABLE IF NOT EXISTS " + tableName + " ("
|
||||||
|
// + col.ID + " INTEGER AUTO_INCREMENT, "
|
||||||
|
// + col.NAME + " VARCHAR(255) NOT NULL UNIQUE, "
|
||||||
|
// + "CONSTRAINT table_const_prim PRIMARY KEY (" + col.ID + "));");
|
||||||
|
//
|
||||||
|
// DatabaseMetaData md = con.getMetaData();
|
||||||
|
//
|
||||||
|
// if (isColumnMissing(md, col.REAL_NAME)) {
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName + " ADD COLUMN "
|
||||||
|
// + col.REAL_NAME + " VARCHAR(255) NOT NULL DEFAULT 'Player';");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (isColumnMissing(md, col.PASSWORD)) {
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName
|
||||||
|
// + " ADD COLUMN " + col.PASSWORD + " VARCHAR(255) NOT NULL DEFAULT '';");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (!col.SALT.isEmpty() && isColumnMissing(md, col.SALT)) {
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName + " ADD COLUMN " + col.SALT + " VARCHAR(255);");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (isColumnMissing(md, col.LAST_IP)) {
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName
|
||||||
|
// + " ADD COLUMN " + col.LAST_IP + " VARCHAR(40);");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (isColumnMissing(md, col.LAST_LOGIN)) {
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName
|
||||||
|
// + " ADD COLUMN " + col.LAST_LOGIN + " TIMESTAMP;");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (isColumnMissing(md, col.REGISTRATION_IP)) {
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName
|
||||||
|
// + " ADD COLUMN " + col.REGISTRATION_IP + " VARCHAR(40);");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (isColumnMissing(md, col.REGISTRATION_DATE)) {
|
||||||
|
// addRegistrationDateColumn(st);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (isColumnMissing(md, col.LASTLOC_X)) {
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName + " ADD COLUMN " + col.LASTLOC_X
|
||||||
|
// + " DOUBLE NOT NULL DEFAULT '0.0';");
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName + " ADD COLUMN " + col.LASTLOC_Y
|
||||||
|
// + " DOUBLE NOT NULL DEFAULT '0.0';");
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName + " ADD COLUMN " + col.LASTLOC_Z
|
||||||
|
// + " DOUBLE NOT NULL DEFAULT '0.0';");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (isColumnMissing(md, col.LASTLOC_WORLD)) {
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName
|
||||||
|
// + " ADD COLUMN " + col.LASTLOC_WORLD + " VARCHAR(255) NOT NULL DEFAULT 'world';");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (isColumnMissing(md, col.LASTLOC_YAW)) {
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName + " ADD COLUMN "
|
||||||
|
// + col.LASTLOC_YAW + " FLOAT;");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (isColumnMissing(md, col.LASTLOC_PITCH)) {
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName + " ADD COLUMN "
|
||||||
|
// + col.LASTLOC_PITCH + " FLOAT;");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (isColumnMissing(md, col.EMAIL)) {
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName
|
||||||
|
// + " ADD COLUMN " + col.EMAIL + " VARCHAR(255);");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (isColumnMissing(md, col.IS_LOGGED)) {
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName
|
||||||
|
// + " ADD COLUMN " + col.IS_LOGGED + " INT NOT NULL DEFAULT '0';");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (isColumnMissing(md, col.HAS_SESSION)) {
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName
|
||||||
|
// + " ADD COLUMN " + col.HAS_SESSION + " INT NOT NULL DEFAULT '0';");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (isColumnMissing(md, col.TOTP_KEY)) {
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName
|
||||||
|
// + " ADD COLUMN " + col.TOTP_KEY + " VARCHAR(32);");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (!col.PLAYER_UUID.isEmpty() && isColumnMissing(md, col.PLAYER_UUID)) {
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName
|
||||||
|
// + " ADD COLUMN " + col.PLAYER_UUID + " VARCHAR(36)");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// logger.info("H2 Setup finished");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// private boolean isColumnMissing(DatabaseMetaData metaData, String columnName) throws SQLException {
|
||||||
|
// try (ResultSet rs = metaData.getColumns(null, null, tableName, columnName)) {
|
||||||
|
// return !rs.next();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void reload() {
|
||||||
|
// close(con);
|
||||||
|
// try {
|
||||||
|
// this.connect();
|
||||||
|
// this.setup();
|
||||||
|
// } catch (SQLException ex) {
|
||||||
|
// logger.logException("Error while reloading H2:", ex);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public PlayerAuth getAuth(String user) {
|
||||||
|
// String sql = "SELECT * FROM " + tableName + " WHERE LOWER(" + col.NAME + ")=LOWER(?);";
|
||||||
|
// try (PreparedStatement pst = con.prepareStatement(sql)) {
|
||||||
|
// pst.setString(1, user);
|
||||||
|
// try (ResultSet rs = pst.executeQuery()) {
|
||||||
|
// if (rs.next()) {
|
||||||
|
// return buildAuthFromResultSet(rs);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } catch (SQLException ex) {
|
||||||
|
// logSqlException(ex);
|
||||||
|
// }
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public Set<String> getRecordsToPurge(long until) {
|
||||||
|
// Set<String> list = new HashSet<>();
|
||||||
|
// String select = "SELECT " + col.NAME + " FROM " + tableName + " WHERE MAX("
|
||||||
|
// + " COALESCE(" + col.LAST_LOGIN + ", 0),"
|
||||||
|
// + " COALESCE(" + col.REGISTRATION_DATE + ", 0)"
|
||||||
|
// + ") < ?;";
|
||||||
|
// try (PreparedStatement selectPst = con.prepareStatement(select)) {
|
||||||
|
// selectPst.setLong(1, until);
|
||||||
|
// try (ResultSet rs = selectPst.executeQuery()) {
|
||||||
|
// while (rs.next()) {
|
||||||
|
// list.add(rs.getString(col.NAME));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } catch (SQLException ex) {
|
||||||
|
// logSqlException(ex);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// return list;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void purgeRecords(Collection<String> toPurge) {
|
||||||
|
// String delete = "DELETE FROM " + tableName + " WHERE " + col.NAME + "=?;";
|
||||||
|
// try (PreparedStatement deletePst = con.prepareStatement(delete)) {
|
||||||
|
// for (String name : toPurge) {
|
||||||
|
// deletePst.setString(1, name.toLowerCase(Locale.ROOT));
|
||||||
|
// deletePst.executeUpdate();
|
||||||
|
// }
|
||||||
|
// } catch (SQLException ex) {
|
||||||
|
// logSqlException(ex);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public boolean removeAuth(String user) {
|
||||||
|
// String sql = "DELETE FROM " + tableName + " WHERE " + col.NAME + "=?;";
|
||||||
|
// try (PreparedStatement pst = con.prepareStatement(sql)) {
|
||||||
|
// pst.setString(1, user.toLowerCase(Locale.ROOT));
|
||||||
|
// pst.executeUpdate();
|
||||||
|
// return true;
|
||||||
|
// } catch (SQLException ex) {
|
||||||
|
// logSqlException(ex);
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void closeConnection() {
|
||||||
|
// try {
|
||||||
|
// if (con != null && !con.isClosed()) {
|
||||||
|
// con.close();
|
||||||
|
// }
|
||||||
|
// } catch (SQLException ex) {
|
||||||
|
// logSqlException(ex);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public DataSourceType getType() {
|
||||||
|
// return DataSourceType.H2;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public List<PlayerAuth> getAllAuths() {
|
||||||
|
// List<PlayerAuth> auths = new ArrayList<>();
|
||||||
|
// String sql = "SELECT * FROM " + tableName + ";";
|
||||||
|
// try (PreparedStatement pst = con.prepareStatement(sql); ResultSet rs = pst.executeQuery()) {
|
||||||
|
// while (rs.next()) {
|
||||||
|
// PlayerAuth auth = buildAuthFromResultSet(rs);
|
||||||
|
// auths.add(auth);
|
||||||
|
// }
|
||||||
|
// } catch (SQLException ex) {
|
||||||
|
// logSqlException(ex);
|
||||||
|
// }
|
||||||
|
// return auths;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public List<String> getLoggedPlayersWithEmptyMail() {
|
||||||
|
// List<String> players = new ArrayList<>();
|
||||||
|
// String sql = "SELECT " + col.REAL_NAME + " FROM " + tableName + " WHERE " + col.IS_LOGGED + " = 1"
|
||||||
|
// + " AND (" + col.EMAIL + " = 'your@email.com' OR " + col.EMAIL + " IS NULL);";
|
||||||
|
// try (Statement st = con.createStatement(); ResultSet rs = st.executeQuery(sql)) {
|
||||||
|
// while (rs.next()) {
|
||||||
|
// players.add(rs.getString(1));
|
||||||
|
// }
|
||||||
|
// } catch (SQLException ex) {
|
||||||
|
// logSqlException(ex);
|
||||||
|
// }
|
||||||
|
// return players;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public List<PlayerAuth> getRecentlyLoggedInPlayers() {
|
||||||
|
// List<PlayerAuth> players = new ArrayList<>();
|
||||||
|
// String sql = "SELECT * FROM " + tableName + " ORDER BY " + col.LAST_LOGIN + " DESC LIMIT 10;";
|
||||||
|
// try (Statement st = con.createStatement(); ResultSet rs = st.executeQuery(sql)) {
|
||||||
|
// while (rs.next()) {
|
||||||
|
// players.add(buildAuthFromResultSet(rs));
|
||||||
|
// }
|
||||||
|
// } catch (SQLException e) {
|
||||||
|
// logSqlException(e);
|
||||||
|
// }
|
||||||
|
// return players;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public boolean setTotpKey(String user, String totpKey) {
|
||||||
|
// String sql = "UPDATE " + tableName + " SET " + col.TOTP_KEY + " = ? WHERE " + col.NAME + " = ?";
|
||||||
|
// try (PreparedStatement pst = con.prepareStatement(sql)) {
|
||||||
|
// pst.setString(1, totpKey);
|
||||||
|
// pst.setString(2, user.toLowerCase(Locale.ROOT));
|
||||||
|
// pst.executeUpdate();
|
||||||
|
// return true;
|
||||||
|
// } catch (SQLException e) {
|
||||||
|
// logSqlException(e);
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private PlayerAuth buildAuthFromResultSet(ResultSet row) throws SQLException {
|
||||||
|
// String salt = !col.SALT.isEmpty() ? row.getString(col.SALT) : null;
|
||||||
|
//
|
||||||
|
// return PlayerAuth.builder()
|
||||||
|
// .name(row.getString(col.NAME))
|
||||||
|
// .email(row.getString(col.EMAIL))
|
||||||
|
// .realName(row.getString(col.REAL_NAME))
|
||||||
|
// .password(row.getString(col.PASSWORD), salt)
|
||||||
|
// .totpKey(row.getString(col.TOTP_KEY))
|
||||||
|
// .lastLogin(getNullableLong(row, col.LAST_LOGIN))
|
||||||
|
// .lastIp(row.getString(col.LAST_IP))
|
||||||
|
// .registrationDate(row.getLong(col.REGISTRATION_DATE))
|
||||||
|
// .registrationIp(row.getString(col.REGISTRATION_IP))
|
||||||
|
// .locX(row.getDouble(col.LASTLOC_X))
|
||||||
|
// .locY(row.getDouble(col.LASTLOC_Y))
|
||||||
|
// .locZ(row.getDouble(col.LASTLOC_Z))
|
||||||
|
// .locWorld(row.getString(col.LASTLOC_WORLD))
|
||||||
|
// .locYaw(row.getFloat(col.LASTLOC_YAW))
|
||||||
|
// .locPitch(row.getFloat(col.LASTLOC_PITCH))
|
||||||
|
// .build();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * Creates the column for registration date and sets all entries to the current timestamp.
|
||||||
|
// * We do so in order to avoid issues with purging, where entries with 0 / NULL might get
|
||||||
|
// * purged immediately on startup otherwise.
|
||||||
|
// *
|
||||||
|
// * @param st Statement object to the database
|
||||||
|
// */
|
||||||
|
// private void addRegistrationDateColumn(Statement st) throws SQLException {
|
||||||
|
// st.executeUpdate("ALTER TABLE " + tableName
|
||||||
|
// + " ADD COLUMN " + col.REGISTRATION_DATE + " TIMESTAMP NOT NULL DEFAULT '0';");
|
||||||
|
//
|
||||||
|
// // Use the timestamp from Java to avoid timezone issues in case JVM and database are out of sync
|
||||||
|
// long currentTimestamp = System.currentTimeMillis();
|
||||||
|
// int updatedRows = st.executeUpdate(String.format("UPDATE %s SET %s = %d;",
|
||||||
|
// tableName, col.REGISTRATION_DATE, currentTimestamp));
|
||||||
|
// logger.info("Created column '" + col.REGISTRATION_DATE + "' and set the current timestamp, "
|
||||||
|
// + currentTimestamp + ", to all " + updatedRows + " rows");
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// String getJdbcUrl(String dataPath, String ignored, String database) {
|
||||||
|
// return "jdbc:h2:" + dataPath + File.separator + database + ".db";
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private static void close(Connection con) {
|
||||||
|
// if (con != null) {
|
||||||
|
// try {
|
||||||
|
// con.close();
|
||||||
|
// } catch (SQLException ex) {
|
||||||
|
// logSqlException(ex);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//
|
||||||
@@ -76,6 +76,9 @@ public class DataSourceProvider implements Provider<DataSource> {
|
|||||||
case SQLITE:
|
case SQLITE:
|
||||||
dataSource = new SQLite(settings, dataFolder);
|
dataSource = new SQLite(settings, dataFolder);
|
||||||
break;
|
break;
|
||||||
|
// case H2:
|
||||||
|
// dataSource = new H2(settings, dataFolder);
|
||||||
|
// break;
|
||||||
default:
|
default:
|
||||||
throw new UnsupportedOperationException("Unknown data source type '" + dataSourceType + "'");
|
throw new UnsupportedOperationException("Unknown data source type '" + dataSourceType + "'");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
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.message.MessageKey;
|
||||||
|
import fr.xephi.authme.message.Messages;
|
||||||
|
import fr.xephi.authme.service.BukkitService;
|
||||||
|
import fr.xephi.authme.settings.Settings;
|
||||||
|
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||||
|
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
|
||||||
|
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();
|
||||||
|
@Inject
|
||||||
|
private BukkitService bukkitService;
|
||||||
|
@Inject
|
||||||
|
private AuthMe plugin;
|
||||||
|
@Inject
|
||||||
|
private Messages messages;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private Settings settings;
|
||||||
|
|
||||||
|
public BedrockAutoLoginListener() {
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isBedrockPlayer(UUID uuid) {
|
||||||
|
return settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) && settings.getProperty(SecuritySettings.FORCE_LOGIN_BEDROCK) && org.geysermc.floodgate.api.FloodgateApi.getInstance().isFloodgateId(uuid) && getServer().getPluginManager().getPlugin("floodgate") != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
String name = event.getPlayer().getName();
|
||||||
|
UUID uuid = event.getPlayer().getUniqueId();
|
||||||
|
if (isBedrockPlayer(uuid) && !authmeApi.isAuthenticated(player) && authmeApi.isRegistered(name)) {
|
||||||
|
authmeApi.forceLogin(player);
|
||||||
|
messages.send(player, MessageKey.BEDROCK_AUTO_LOGGED_IN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,32 +1,32 @@
|
|||||||
package fr.xephi.authme.listener;
|
package fr.xephi.authme.listener;
|
||||||
//Prevent Ghost Players
|
//Prevent Ghost Players
|
||||||
|
|
||||||
|
import fr.xephi.authme.message.MessageKey;
|
||||||
|
import fr.xephi.authme.service.CommonService;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
public class DoubleLoginFixListener implements Listener {
|
public class DoubleLoginFixListener implements Listener {
|
||||||
private final Plugin plugin;
|
@Inject
|
||||||
|
private CommonService service;
|
||||||
|
|
||||||
|
|
||||||
public DoubleLoginFixListener(Plugin plugin) {
|
|
||||||
this.plugin = plugin;
|
|
||||||
|
|
||||||
|
public DoubleLoginFixListener() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
Collection<? extends Player> PlayerList = Bukkit.getServer().getOnlinePlayers();
|
Collection<? extends Player> PlayerList = Bukkit.getServer().getOnlinePlayers();
|
||||||
HashSet<String> PlayerSet = new HashSet<String>();
|
HashSet<String> PlayerSet = new HashSet<String>();
|
||||||
for (Player ep : PlayerList) {
|
for (Player ep : PlayerList) {
|
||||||
if (PlayerSet.contains(ep.getName().toLowerCase())) {
|
if (PlayerSet.contains(ep.getName().toLowerCase())) {
|
||||||
ep.kickPlayer("You have been disconnected due to doubled login.");
|
ep.kickPlayer(service.retrieveSingleMessage(ep.getPlayer(), MessageKey.DOUBLE_LOGIN_FIX));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
PlayerSet.add(ep.getName().toLowerCase());
|
PlayerSet.add(ep.getName().toLowerCase());
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
package fr.xephi.authme.listener;
|
package fr.xephi.authme.listener;
|
||||||
|
|
||||||
import com.comphenix.protocol.PacketType;
|
import com.comphenix.protocol.PacketType;
|
||||||
import com.comphenix.protocol.ProtocolLibrary;
|
import com.comphenix.protocol.ProtocolLibrary;
|
||||||
import com.comphenix.protocol.events.ListenerPriority;
|
import com.comphenix.protocol.events.ListenerPriority;
|
||||||
@@ -6,6 +7,11 @@ import com.comphenix.protocol.events.PacketAdapter;
|
|||||||
import com.comphenix.protocol.events.PacketEvent;
|
import com.comphenix.protocol.events.PacketEvent;
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.api.v3.AuthMeApi;
|
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.Settings;
|
||||||
import fr.xephi.authme.settings.properties.HooksSettings;
|
import fr.xephi.authme.settings.properties.HooksSettings;
|
||||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||||
@@ -21,36 +27,70 @@ import org.bukkit.event.player.PlayerQuitEvent;
|
|||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
import javax.inject.Inject;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import static fr.xephi.authme.util.PlayerUtils.getPlayerIp;
|
||||||
|
import static fr.xephi.authme.util.PlayerUtils.isNpc;
|
||||||
import static org.bukkit.Bukkit.getLogger;
|
import static org.bukkit.Bukkit.getLogger;
|
||||||
import static org.bukkit.Bukkit.getServer;
|
import static org.bukkit.Bukkit.getServer;
|
||||||
|
|
||||||
public class GuiCaptchaHandler implements Listener {
|
public class GuiCaptchaHandler implements Listener {
|
||||||
//define AuthMeApi
|
//define AuthMeApi
|
||||||
private final AuthMeApi authmeApi = AuthMeApi.getInstance();
|
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;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private Settings settings;
|
||||||
|
|
||||||
|
|
||||||
|
private PacketAdapter chatPacketListener;
|
||||||
|
private PacketAdapter windowPacketListener;
|
||||||
|
|
||||||
//define timesLeft
|
//define timesLeft
|
||||||
public int timesLeft = 3;
|
private int timesLeft = 3;
|
||||||
//Use ConcurrentHashMap to store player and their close reason
|
//Use ConcurrentHashMap to store player and their close reason
|
||||||
/* We used many async tasks so there is concurrent**/
|
/* We used many async tasks so there is concurrent**/
|
||||||
public static ConcurrentHashMap<Player, String> closeReasonMap = new ConcurrentHashMap<>();
|
public static HashMap<Player, String> closeReasonMap = new HashMap<>();
|
||||||
//define randomStringSet
|
//define randomStringSet
|
||||||
String randomSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz!@#%&*()_+";
|
String randomSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcdefghijklmnopqrstuvwxyz!@#%&*()_+";
|
||||||
String randomString = "";
|
String randomString = "";
|
||||||
Random randomItemSet = new Random();
|
Random randomItemSet = new Random();
|
||||||
Random howManyRandom = new Random();
|
Random howManyRandom = new Random();
|
||||||
|
private boolean isPacketListenersActive = false;
|
||||||
|
|
||||||
|
int howLongIsRandomString;
|
||||||
|
|
||||||
|
public GuiCaptchaHandler() {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected List<String> whiteList = AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_COUNTRY_WHITELIST);
|
||||||
|
|
||||||
|
private boolean isBedrockPlayer(UUID uuid) {
|
||||||
|
return settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) && settings.getProperty(SecuritySettings.GUI_CAPTCHA_BE_COMPATIBILITY) && org.geysermc.floodgate.api.FloodgateApi.getInstance().isFloodgateId(uuid) && getServer().getPluginManager().getPlugin("floodgate") != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int howLongIsRandomString = (howManyRandom.nextInt(3) + 1);
|
private void addPacketListeners() {
|
||||||
|
if (!isPacketListenersActive) {
|
||||||
public GuiCaptchaHandler(Plugin plugin) {
|
ProtocolLibrary.getProtocolManager().addPacketListener(windowPacketListener);
|
||||||
this.plugin = plugin;
|
ProtocolLibrary.getProtocolManager().addPacketListener(chatPacketListener);
|
||||||
|
isPacketListenersActive = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -60,40 +100,37 @@ public class GuiCaptchaHandler implements Listener{
|
|||||||
Player player = (Player) event.getWhoClicked();
|
Player player = (Player) event.getWhoClicked();
|
||||||
ItemStack currentItem = event.getCurrentItem();
|
ItemStack currentItem = event.getCurrentItem();
|
||||||
if (!authmeApi.isRegistered(player.getName()) && !closeReasonMap.containsKey(player)) {
|
if (!authmeApi.isRegistered(player.getName()) && !closeReasonMap.containsKey(player)) {
|
||||||
if (AuthMe.settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) && AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_BE_COMPATIBILITY) && org.geysermc.floodgate.api.FloodgateApi.getInstance().isFloodgateId(event.getWhoClicked().getUniqueId()) && (getServer().getPluginManager().isPluginEnabled("floodgate") || getServer().getPluginManager().getPlugin("floodgate") != null)) {
|
if (isBedrockPlayer(player.getUniqueId())) {
|
||||||
if (!closeReasonMap.containsKey(player)) {
|
|
||||||
closeReasonMap.put(player,"verified");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (currentItem != null && currentItem.getType().equals(Material.REDSTONE_BLOCK)) {
|
if (currentItem != null && currentItem.getType().equals(Material.REDSTONE_BLOCK)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
closeReasonMap.put(player, "verified");
|
closeReasonMap.put(player, "verified");
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
player.sendMessage("§a验证完成");
|
messages.send(player, MessageKey.GUI_CAPTCHA_VERIFIED);
|
||||||
} else {
|
}
|
||||||
player.sendMessage("§c验证失败,你还有" + timesLeft + "§c次机会");
|
|
||||||
timesLeft--;
|
|
||||||
}
|
|
||||||
//force to string
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
randomString = "";
|
randomString = "";
|
||||||
Player playerunreg = event.getPlayer();
|
Player playerunreg = event.getPlayer();
|
||||||
String name = playerunreg.getName();
|
String name = playerunreg.getName();
|
||||||
if (!authmeApi.isRegistered(name)) {
|
if (!authmeApi.isRegistered(name) && !isNpc(playerunreg)) {
|
||||||
if (AuthMe.settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) && AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_BE_COMPATIBILITY) && org.geysermc.floodgate.api.FloodgateApi.getInstance().isFloodgateId(event.getPlayer().getUniqueId()) && (getServer().getPluginManager().isPluginEnabled("floodgate") || getServer().getPluginManager().getPlugin("floodgate") != null)) {
|
if (!whiteList.isEmpty()) {
|
||||||
closeReasonMap.put(playerunreg, "verified");
|
String ip = getPlayerIp(playerunreg);
|
||||||
playerunreg.sendMessage("§a基岩版自动验证完成");
|
if (whiteList.contains(authmeApi.getCountryCode(ip)) && ip != null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(this.plugin, () -> {
|
}
|
||||||
|
if (isBedrockPlayer(playerunreg.getUniqueId())) {
|
||||||
|
closeReasonMap.put(playerunreg, "verified");
|
||||||
|
messages.send(playerunreg, MessageKey.GUI_CAPTCHA_VERIFIED_AUTO_BEDROCK);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
bukkitService.runTaskAsynchronously(() -> {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
howLongIsRandomString = (howManyRandom.nextInt(3) + 1);
|
howLongIsRandomString = (howManyRandom.nextInt(3) + 1);
|
||||||
for (int i = 0; i < howLongIsRandomString; i++) {
|
for (int i = 0; i < howLongIsRandomString; i++) {
|
||||||
@@ -106,102 +143,93 @@ public class GuiCaptchaHandler implements Listener{
|
|||||||
// 将字符追加到字符串生成器
|
// 将字符追加到字符串生成器
|
||||||
sb.append(randomChar);
|
sb.append(randomChar);
|
||||||
}
|
}
|
||||||
|
bukkitService.runTask(() -> {
|
||||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
|
||||||
randomString = sb.toString();
|
randomString = sb.toString();
|
||||||
Random random_blockpos = new Random();
|
Random random_blockpos = new Random();
|
||||||
AtomicInteger random_num = new AtomicInteger(random_blockpos.nextInt(26));
|
AtomicInteger random_num = new AtomicInteger(random_blockpos.nextInt(26));
|
||||||
Inventory menu = Bukkit.createInventory(null, 27, randomString + "请验证你是真人");
|
Inventory menu = Bukkit.createInventory(playerunreg, 27, messages.retrieveSingle(playerunreg, MessageKey.GUI_CAPTCHA_WINDOW_NAME, randomString));
|
||||||
ItemStack item = new ItemStack(Material.REDSTONE_BLOCK);
|
ItemStack item = new ItemStack(Material.REDSTONE_BLOCK);
|
||||||
ItemMeta meta = item.getItemMeta();
|
ItemMeta meta = item.getItemMeta();
|
||||||
try {
|
try {
|
||||||
if (meta != null) {
|
if (meta != null) {
|
||||||
meta.setDisplayName("§a我是真人");
|
meta.setDisplayName(messages.retrieveSingle(playerunreg, MessageKey.GUI_CAPTCHA_CLICKABLE_NAME, randomString));
|
||||||
item.setItemMeta(meta);
|
item.setItemMeta(meta);
|
||||||
}
|
}
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
getLogger().log(Level.WARNING, "Unexpected error occurred while setting item meta.");
|
getLogger().log(Level.WARNING, "Unexpected error occurred while setting item meta.");
|
||||||
}
|
}
|
||||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
windowPacketListener = new PacketAdapter(this.plugin, ListenerPriority.HIGHEST, PacketType.Play.Client.CLOSE_WINDOW) {
|
||||||
menu.setItem(random_num.get(), item);
|
@Override
|
||||||
|
public void onPacketReceiving(PacketEvent event) {
|
||||||
|
if (!closeReasonMap.containsKey(playerunreg) && !authmeApi.isRegistered(playerunreg.getName())) {
|
||||||
|
if (timesLeft <= 0) {
|
||||||
|
bukkitService.runTask(() -> {
|
||||||
|
playerunreg.kickPlayer(service.retrieveSingleMessage(playerunreg, MessageKey.GUI_CAPTCHA_KICK_FAILED));
|
||||||
});
|
});
|
||||||
|
timesLeft = 3;
|
||||||
|
} else {
|
||||||
|
--timesLeft;
|
||||||
|
if (timesLeft <= 0) {
|
||||||
|
bukkitService.runTask(() -> {
|
||||||
|
playerunreg.kickPlayer(service.retrieveSingleMessage(playerunreg, MessageKey.GUI_CAPTCHA_KICK_FAILED));
|
||||||
|
});
|
||||||
|
timesLeft = 3;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
messages.send(playerunreg, MessageKey.GUI_CAPTCHA_RETRY_MESSAGE, String.valueOf(timesLeft));
|
||||||
|
event.setCancelled(true);
|
||||||
|
random_num.set(random_blockpos.nextInt(26));
|
||||||
|
bukkitService.runTask(() -> {
|
||||||
|
menu.clear();
|
||||||
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, () -> {
|
};
|
||||||
getLogger().warning("AuthMe detected that your GUI captcha timeout seconds(" + AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) + ") is bigger than the Login timeout seconds(" +
|
chatPacketListener = new PacketAdapter(this.plugin, ListenerPriority.HIGHEST, PacketType.Play.Client.CHAT) {
|
||||||
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.");
|
@Override
|
||||||
|
public void onPacketReceiving(PacketEvent event) {
|
||||||
|
if (!closeReasonMap.containsKey(playerunreg) && !authmeApi.isRegistered(playerunreg.getName())) {
|
||||||
|
messages.send(playerunreg, MessageKey.GUI_CAPTCHA_DENIED_MESSAGE);
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
addPacketListeners();
|
||||||
|
//Open captcha inventory
|
||||||
|
menu.setItem(random_num.get(), item);
|
||||||
|
playerunreg.openInventory(menu);
|
||||||
|
if (settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) > 0) {
|
||||||
|
long timeOut = settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT);
|
||||||
|
if (settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) > settings.getProperty(RestrictionSettings.TIMEOUT)) {
|
||||||
|
bukkitService.runTask(() -> {
|
||||||
|
getLogger().warning("AuthMe detected that your GUI captcha timeout seconds(" + settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) + ") is bigger than the Login timeout seconds(" +
|
||||||
|
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);
|
timeOut = settings.getProperty(RestrictionSettings.TIMEOUT);
|
||||||
}
|
}
|
||||||
long finalTimeOut = timeOut;
|
long finalTimeOut = timeOut;
|
||||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
bukkitService.runTask(() -> {
|
||||||
Bukkit.getScheduler().runTaskLater(this.plugin, () -> {
|
bukkitService.runTaskLater(() -> {
|
||||||
if (!closeReasonMap.containsKey(playerunreg) && !authmeApi.isRegistered(playerunreg.getName())) {
|
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
|
timesLeft = 3; // Reset the attempt counter
|
||||||
}
|
}
|
||||||
}, finalTimeOut * 20L);
|
}, finalTimeOut * 20L);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
|
||||||
ProtocolLibrary.getProtocolManager().addPacketListener(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请先完成人机验证!");
|
|
||||||
});
|
|
||||||
timesLeft = 3;
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
timesLeft--;
|
|
||||||
playerunreg.sendMessage("§c请先完成验证!,你还有" + timesLeft + "次机会");
|
|
||||||
|
|
||||||
}
|
|
||||||
event.setCancelled(true);
|
|
||||||
random_num.set(random_blockpos.nextInt(26));
|
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
|
||||||
Bukkit.getScheduler().runTask(plugin, () -> {
|
|
||||||
menu.clear();
|
|
||||||
menu.setItem(random_num.get(), item);
|
|
||||||
});
|
|
||||||
|
|
||||||
Bukkit.getScheduler().runTask(plugin, () -> {
|
|
||||||
playerunreg.openInventory(menu);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
Bukkit.getScheduler().runTask(this.plugin, () -> {
|
|
||||||
|
|
||||||
ProtocolLibrary.getProtocolManager().addPacketListener(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请先完成验证!");
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void deletePlayerData(UUID playerUUID) {
|
private void deletePlayerData(UUID playerUUID) {
|
||||||
// 获取服务器的存储文件夹路径
|
// 获取服务器的存储文件夹路径
|
||||||
File serverFolder = Bukkit.getServer().getWorldContainer();
|
File serverFolder = Bukkit.getServer().getWorldContainer();
|
||||||
String worldFolderName = AuthMe.settings.getProperty(SecuritySettings.DELETE_PLAYER_DATA_WORLD);
|
String worldFolderName = settings.getProperty(SecuritySettings.DELETE_PLAYER_DATA_WORLD);
|
||||||
// 构建playerdata文件夹路径
|
// 构建playerdata文件夹路径
|
||||||
File playerDataFolder = new File(serverFolder, File.separator + worldFolderName + File.separator + "playerdata");
|
File playerDataFolder = new File(serverFolder, File.separator + worldFolderName + File.separator + "playerdata");
|
||||||
|
|
||||||
@@ -216,29 +244,39 @@ public class GuiCaptchaHandler implements Listener{
|
|||||||
private void deletePlayerStats(UUID playerUUID) {
|
private void deletePlayerStats(UUID playerUUID) {
|
||||||
// 获取服务器的存储文件夹路径
|
// 获取服务器的存储文件夹路径
|
||||||
File serverFolder = Bukkit.getServer().getWorldContainer();
|
File serverFolder = Bukkit.getServer().getWorldContainer();
|
||||||
String worldFolderName = AuthMe.settings.getProperty(SecuritySettings.DELETE_PLAYER_DATA_WORLD);
|
String worldFolderName = settings.getProperty(SecuritySettings.DELETE_PLAYER_DATA_WORLD);
|
||||||
// 构建stats文件夹路径
|
// 构建stats文件夹路径
|
||||||
File statsFolder = new File(serverFolder, File.separator + worldFolderName + File.separator + "stats");
|
File statsFolder = new File(serverFolder, File.separator + worldFolderName + File.separator + "stats");
|
||||||
// 构建玩家统计数据文件路径
|
// 构建玩家统计数据文件路径
|
||||||
File statsFile = new File(statsFolder, File.separator + playerUUID + ".json");
|
File statsFile = new File(statsFolder, File.separator + playerUUID + ".json");
|
||||||
// 删除玩家统计数据文件
|
// 删除玩家统计数据文件
|
||||||
|
|
||||||
if (statsFile.exists()) {
|
if (statsFile.exists()) {
|
||||||
statsFile.delete();
|
statsFile.delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void deleteAuthMePlayerData(UUID playerUUID) {
|
||||||
|
File pluginFolder = plugin.getDataFolder();
|
||||||
|
File path = new File(pluginFolder, File.separator + "playerdata" + File.separator + playerUUID);
|
||||||
|
File dataFile = new File(path, File.separator + "data.json");
|
||||||
|
if (dataFile.exists()) {
|
||||||
|
dataFile.delete();
|
||||||
|
path.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerQuit(PlayerQuitEvent event) {
|
public void onPlayerQuit(PlayerQuitEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
String name = player.getName();
|
String name = player.getName();
|
||||||
UUID playerUUID = event.getPlayer().getUniqueId();
|
UUID playerUUID = event.getPlayer().getUniqueId();
|
||||||
if (!authmeApi.isRegistered(name)) {
|
if (!authmeApi.isRegistered(name)) {
|
||||||
if(AuthMe.settings.getProperty(SecuritySettings.DELETE_UNVERIFIED_PLAYER_DATA) && !closeReasonMap.containsKey(player)){
|
if (settings.getProperty(SecuritySettings.DELETE_UNVERIFIED_PLAYER_DATA) && !closeReasonMap.containsKey(player)) {
|
||||||
Bukkit.getScheduler().runTaskLater(this.plugin , () -> {
|
bukkitService.runTaskLater(() -> {
|
||||||
if (!player.isOnline()) {
|
if (!player.isOnline()) {
|
||||||
deletePlayerData(playerUUID);
|
deletePlayerData(playerUUID);
|
||||||
deletePlayerStats(playerUUID);
|
deletePlayerStats(playerUUID);
|
||||||
|
deleteAuthMePlayerData(playerUUID);
|
||||||
}
|
}
|
||||||
}, 100L);
|
}, 100L);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
package fr.xephi.authme.listener;
|
package fr.xephi.authme.listener;
|
||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.api.v3.AuthMeApi;
|
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||||
|
import fr.xephi.authme.message.MessageKey;
|
||||||
|
import fr.xephi.authme.message.Messages;
|
||||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||||
|
import fr.xephi.authme.util.TeleportUtils;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
@@ -11,36 +15,52 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
|
||||||
public class LoginLocationFixListener implements Listener {
|
public class LoginLocationFixListener implements Listener {
|
||||||
private final Plugin plugin;
|
@Inject
|
||||||
|
private AuthMe plugin;
|
||||||
|
@Inject
|
||||||
|
private Messages messages;
|
||||||
private final AuthMeApi authmeApi = AuthMeApi.getInstance();
|
private final AuthMeApi authmeApi = AuthMeApi.getInstance();
|
||||||
public LoginLocationFixListener(Plugin plugin) {
|
|
||||||
this.plugin = plugin;
|
public LoginLocationFixListener() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Material materialPortal = Material.matchMaterial("PORTAL");
|
||||||
|
private final boolean isSmartAsyncTeleport = AuthMe.settings.getProperty(SecuritySettings.SMART_ASYNC_TELEPORT);
|
||||||
|
private final boolean isFixPortalStuck = AuthMe.settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_PORTAL);
|
||||||
|
private final boolean isFixGroundStuck = AuthMe.settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_UNDERGROUND);
|
||||||
BlockFace[] faces = {BlockFace.WEST, BlockFace.EAST, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.SOUTH_EAST, BlockFace.SOUTH_WEST, BlockFace.NORTH_EAST, BlockFace.NORTH_WEST};
|
BlockFace[] faces = {BlockFace.WEST, BlockFace.EAST, BlockFace.NORTH, BlockFace.SOUTH, BlockFace.SOUTH_EAST, BlockFace.SOUTH_WEST, BlockFace.NORTH_EAST, BlockFace.NORTH_WEST};
|
||||||
|
|
||||||
|
static {
|
||||||
|
if (materialPortal == null) {
|
||||||
|
materialPortal = Material.matchMaterial("PORTAL_BLOCK");
|
||||||
|
if (materialPortal == null) {
|
||||||
|
materialPortal = Material.matchMaterial("NETHER_PORTAL");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
Material material = Material.matchMaterial("PORTAL");
|
|
||||||
if (material == null) {
|
|
||||||
material = Material.matchMaterial("PORTAL_BLOCK");
|
|
||||||
if(material == null){
|
|
||||||
material = Material.matchMaterial("NETHER_PORTAL");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Location JoinLocation = player.getLocation().getBlock().getLocation().add(0.5, 0.1, 0.5);
|
Location JoinLocation = player.getLocation().getBlock().getLocation().add(0.5, 0.1, 0.5);
|
||||||
if (AuthMe.settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_PORTAL)) {
|
if (isFixPortalStuck) {
|
||||||
if (!JoinLocation.getBlock().getType().equals(material) && !JoinLocation.getBlock().getRelative(BlockFace.UP).getType().equals(material)) {
|
if (!JoinLocation.getBlock().getType().equals(materialPortal) && !JoinLocation.getBlock().getRelative(BlockFace.UP).getType().equals(materialPortal)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Block JoinBlock = JoinLocation.getBlock();
|
Block JoinBlock = JoinLocation.getBlock();
|
||||||
boolean solved = false;
|
boolean solved = false;
|
||||||
for (BlockFace face : faces) {
|
for (BlockFace face : faces) {
|
||||||
if (JoinBlock.getRelative(face).getType().equals(Material.AIR) && JoinBlock.getRelative(face).getRelative(BlockFace.UP).getType().equals(Material.AIR)) {
|
if (JoinBlock.getRelative(face).getType().equals(Material.AIR) && JoinBlock.getRelative(face).getRelative(BlockFace.UP).getType().equals(Material.AIR)) {
|
||||||
|
if (isSmartAsyncTeleport) {
|
||||||
|
TeleportUtils.teleport(player, JoinBlock.getRelative(face).getLocation().add(0.5, 0.1, 0.5));
|
||||||
|
} else {
|
||||||
player.teleport(JoinBlock.getRelative(face).getLocation().add(0.5, 0.1, 0.5));
|
player.teleport(JoinBlock.getRelative(face).getLocation().add(0.5, 0.1, 0.5));
|
||||||
|
}
|
||||||
solved = true;
|
solved = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -49,8 +69,8 @@ public class LoginLocationFixListener implements Listener{
|
|||||||
JoinBlock.getRelative(BlockFace.UP).breakNaturally();
|
JoinBlock.getRelative(BlockFace.UP).breakNaturally();
|
||||||
JoinBlock.breakNaturally();
|
JoinBlock.breakNaturally();
|
||||||
}
|
}
|
||||||
player.sendMessage("§a你在登录时卡在了地狱门, 现已修正");
|
messages.send(player, MessageKey.LOCATION_FIX_PORTAL);
|
||||||
} else if (AuthMe.settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_UNDERGROUND)) {
|
} else if (isFixGroundStuck) {
|
||||||
Material UpType = JoinLocation.getBlock().getRelative(BlockFace.UP).getType();
|
Material UpType = JoinLocation.getBlock().getRelative(BlockFace.UP).getType();
|
||||||
World world = player.getWorld();
|
World world = player.getWorld();
|
||||||
int MaxHeight = world.getMaxHeight();
|
int MaxHeight = world.getMaxHeight();
|
||||||
@@ -67,13 +87,21 @@ public class LoginLocationFixListener implements Listener{
|
|||||||
if (JoinBlock.getRelative(BlockFace.DOWN).getType().equals(Material.LAVA)) {
|
if (JoinBlock.getRelative(BlockFace.DOWN).getType().equals(Material.LAVA)) {
|
||||||
JoinBlock.getRelative(BlockFace.DOWN).setType(Material.DIRT);
|
JoinBlock.getRelative(BlockFace.DOWN).setType(Material.DIRT);
|
||||||
}
|
}
|
||||||
|
if (isSmartAsyncTeleport) {
|
||||||
|
TeleportUtils.teleport(player, JoinBlock.getLocation().add(0.5, 0.1, 0.5));
|
||||||
|
} else {
|
||||||
player.teleport(JoinBlock.getLocation().add(0.5, 0.1, 0.5));
|
player.teleport(JoinBlock.getLocation().add(0.5, 0.1, 0.5));
|
||||||
player.sendMessage("§a你被埋住了, 坐标已修正, 下次下线之前请小心!");
|
}
|
||||||
|
messages.send(player, MessageKey.LOCATION_FIX_UNDERGROUND);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == MaxHeight) {
|
if (i == MaxHeight) {
|
||||||
|
if (isSmartAsyncTeleport) {
|
||||||
|
TeleportUtils.teleport(player, JoinBlock.getLocation().add(0.5, 1.1, 0.5));
|
||||||
|
} else {
|
||||||
player.teleport(JoinBlock.getLocation().add(0.5, 1.1, 0.5));
|
player.teleport(JoinBlock.getLocation().add(0.5, 1.1, 0.5));
|
||||||
player.sendMessage("§a你被埋住了, 坐标无法修正, 只好送你去了最高点, 自求多福吧少年~");
|
}
|
||||||
|
messages.send(player, MessageKey.LOCATION_FIX_UNDERGROUND_CANT_FIX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,7 @@
|
|||||||
package fr.xephi.authme.listener;
|
package fr.xephi.authme.listener;
|
||||||
|
|
||||||
import fr.xephi.authme.data.QuickCommandsProtectionManager;
|
|
||||||
import fr.xephi.authme.datasource.DataSource;
|
|
||||||
import fr.xephi.authme.message.Messages;
|
|
||||||
import fr.xephi.authme.permission.PermissionsManager;
|
|
||||||
import fr.xephi.authme.process.Management;
|
|
||||||
import fr.xephi.authme.service.AntiBotService;
|
|
||||||
import fr.xephi.authme.service.BukkitService;
|
|
||||||
import fr.xephi.authme.service.JoinMessageService;
|
|
||||||
import fr.xephi.authme.service.TeleportationService;
|
|
||||||
import fr.xephi.authme.service.ValidationService;
|
|
||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.settings.SpawnLoader;
|
import fr.xephi.authme.settings.properties.PluginSettings;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
@@ -26,18 +16,26 @@ public class PlayerListenerHigherThan18 implements Listener {
|
|||||||
@Inject
|
@Inject
|
||||||
private ListenerService listenerService;
|
private ListenerService listenerService;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private Settings settings;
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
|
@EventHandler(ignoreCancelled = true, priority = EventPriority.LOWEST)
|
||||||
public void onPlayerPickupItem(EntityPickupItemEvent event) {
|
public void onPlayerPickupItem(EntityPickupItemEvent event) {
|
||||||
if (listenerService.shouldCancelEvent(event)) {
|
if (listenerService.shouldCancelEvent(event)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOWEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onSwitchHand(PlayerSwapHandItemsEvent event) {
|
public void onSwitchHand(PlayerSwapHandItemsEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
if (!player.isSneaking() || !player.hasPermission("keybindings.use"))
|
if ((!player.isSneaking() || !player.hasPermission("keybindings.use")) &&
|
||||||
|
settings.getProperty(PluginSettings.MENU_UNREGISTER_COMPATIBILITY)) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
if (settings.getProperty(PluginSettings.MENU_UNREGISTER_COMPATIBILITY)) {
|
||||||
Bukkit.dispatchCommand(event.getPlayer(), "help");
|
Bukkit.dispatchCommand(event.getPlayer(), "help");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,13 +4,84 @@ package fr.xephi.authme.message;
|
|||||||
* Keys for translatable messages managed by {@link Messages}.
|
* Keys for translatable messages managed by {@link Messages}.
|
||||||
*/
|
*/
|
||||||
public enum MessageKey {
|
public enum MessageKey {
|
||||||
/** In order to use this command you must be authenticated! */
|
/**
|
||||||
|
* You have been disconnected due to doubled login.
|
||||||
|
*/
|
||||||
|
DOUBLE_LOGIN_FIX("double_login_fix.fix_message"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* You are stuck in portal during Login.
|
||||||
|
*/
|
||||||
|
LOCATION_FIX_PORTAL("login_location_fix.fix_portal"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* You are stuck underground during Login.
|
||||||
|
*/
|
||||||
|
LOCATION_FIX_UNDERGROUND("login_location_fix.fix_underground"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* You are stuck underground during Login, but we cant fix it.
|
||||||
|
*/
|
||||||
|
LOCATION_FIX_UNDERGROUND_CANT_FIX("login_location_fix.cannot_fix_underground"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bedrock auto login success!
|
||||||
|
*/
|
||||||
|
BEDROCK_AUTO_LOGGED_IN("bedrock_auto_login.success"),
|
||||||
|
|
||||||
|
/**
|
||||||
|
* %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"),
|
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"),
|
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"),
|
DENIED_CHAT("error.denied_chat"),
|
||||||
|
|
||||||
/** AntiBot protection mode is enabled! You have to wait some minutes before joining the server. */
|
/** AntiBot protection mode is enabled! You have to wait some minutes before joining the server. */
|
||||||
|
|||||||
@@ -149,6 +149,10 @@ public class MessageUpdater {
|
|||||||
.put("verification", "Verification code")
|
.put("verification", "Verification code")
|
||||||
.put("time", "Time units")
|
.put("time", "Time units")
|
||||||
.put("two_factor", "Two-factor authentication")
|
.put("two_factor", "Two-factor authentication")
|
||||||
|
.put("gui_captcha", "3rd party features: GUI Captcha")
|
||||||
|
.put("bedrock_auto_login", "3rd party features: Bedrock Auto Login")
|
||||||
|
.put("login_location_fix", "3rd party features: Login Location Fix")
|
||||||
|
.put("double_login_fix", "3rd party features: Double Login Fix")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Set<String> addedKeys = new HashSet<>();
|
Set<String> addedKeys = new HashSet<>();
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class AntiBotService implements SettingsDependent {
|
|||||||
// Delay the schedule on first start
|
// Delay the schedule on first start
|
||||||
if (startup) {
|
if (startup) {
|
||||||
int delay = settings.getProperty(ProtectionSettings.ANTIBOT_DELAY);
|
int delay = settings.getProperty(ProtectionSettings.ANTIBOT_DELAY);
|
||||||
bukkitService.scheduleSyncDelayedTask(enableTask, delay * TICKS_PER_SECOND);
|
bukkitService.scheduleSyncDelayedTask(enableTask, (long) delay * TICKS_PER_SECOND);
|
||||||
startup = false;
|
startup = false;
|
||||||
} else {
|
} else {
|
||||||
enableTask.run();
|
enableTask.run();
|
||||||
@@ -91,7 +91,7 @@ public class AntiBotService implements SettingsDependent {
|
|||||||
disableTask.cancel();
|
disableTask.cancel();
|
||||||
}
|
}
|
||||||
// Schedule auto-disable
|
// Schedule auto-disable
|
||||||
disableTask = bukkitService.runTaskLater(this::stopProtection, duration * TICKS_PER_MINUTE);
|
disableTask = bukkitService.runTaskLater(this::stopProtection, (long) duration * TICKS_PER_MINUTE);
|
||||||
antiBotStatus = AntiBotStatus.ACTIVE;
|
antiBotStatus = AntiBotStatus.ACTIVE;
|
||||||
bukkitService.scheduleSyncTaskFromOptionallyAsyncTask(() -> {
|
bukkitService.scheduleSyncTaskFromOptionallyAsyncTask(() -> {
|
||||||
// Inform admins
|
// Inform admins
|
||||||
|
|||||||
@@ -8,6 +8,13 @@ import fr.xephi.authme.output.LogLevel;
|
|||||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||||
|
|
||||||
public final class PluginSettings implements SettingsHolder {
|
public final class PluginSettings implements SettingsHolder {
|
||||||
|
@Comment({
|
||||||
|
"Should we execute /help command when unregistered players press Shift+F?",
|
||||||
|
"This keeps compatibility with some menu plugins",
|
||||||
|
"If you are using TrMenu, don't enable this because TrMenu already implemented this."
|
||||||
|
})
|
||||||
|
public static final Property<Boolean> MENU_UNREGISTER_COMPATIBILITY =
|
||||||
|
newProperty("3rdPartyFeature.compatibility.menuPlugins", true);
|
||||||
|
|
||||||
@Comment({
|
@Comment({
|
||||||
"Do you want to enable the session feature?",
|
"Do you want to enable the session feature?",
|
||||||
|
|||||||
@@ -2,12 +2,14 @@ package fr.xephi.authme.settings.properties;
|
|||||||
|
|
||||||
import ch.jalu.configme.Comment;
|
import ch.jalu.configme.Comment;
|
||||||
import ch.jalu.configme.SettingsHolder;
|
import ch.jalu.configme.SettingsHolder;
|
||||||
|
|
||||||
import ch.jalu.configme.properties.Property;
|
import ch.jalu.configme.properties.Property;
|
||||||
import fr.xephi.authme.security.HashAlgorithm;
|
import fr.xephi.authme.security.HashAlgorithm;
|
||||||
import fr.xephi.authme.settings.EnumSetProperty;
|
import fr.xephi.authme.settings.EnumSetProperty;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import static ch.jalu.configme.properties.PropertyInitializer.newListProperty;
|
||||||
import static ch.jalu.configme.properties.PropertyInitializer.newLowercaseStringSetProperty;
|
import static ch.jalu.configme.properties.PropertyInitializer.newLowercaseStringSetProperty;
|
||||||
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||||
|
|
||||||
@@ -19,6 +21,15 @@ public final class SecuritySettings implements SettingsHolder {
|
|||||||
public static final Property<Boolean> STOP_SERVER_ON_PROBLEM =
|
public static final Property<Boolean> STOP_SERVER_ON_PROBLEM =
|
||||||
newProperty("Security.SQLProblem.stopServer", false);
|
newProperty("Security.SQLProblem.stopServer", false);
|
||||||
|
|
||||||
|
@Comment({"Should send GUI captcha by country code whitelist?",
|
||||||
|
"If the country of the player is in this list, the captcha won't be sent."})
|
||||||
|
public static final Property<List<String>> GUI_CAPTCHA_COUNTRY_WHITELIST =
|
||||||
|
newListProperty("3rdPartyFeature.captcha.whiteList");
|
||||||
|
|
||||||
|
@Comment({"Should we let Bedrock players login automatically?",
|
||||||
|
"(Requires hookFloodgate to be true & floodgate loaded)"})
|
||||||
|
public static final Property<Boolean> FORCE_LOGIN_BEDROCK = newProperty("3rdPartyFeature.features.bedrockAutoLogin", false);
|
||||||
|
|
||||||
@Comment("Enable the new feature to prevent ghost players?")
|
@Comment("Enable the new feature to prevent ghost players?")
|
||||||
public static final Property<Boolean> ANTI_GHOST_PLAYERS = newProperty("3rdPartyFeature.fixes.antiGhostPlayer", false);
|
public static final Property<Boolean> ANTI_GHOST_PLAYERS = newProperty("3rdPartyFeature.fixes.antiGhostPlayer", false);
|
||||||
|
|
||||||
@@ -43,9 +54,6 @@ public final class SecuritySettings implements SettingsHolder {
|
|||||||
@Comment("Which world's player data should be deleted?(Enter the world *FOLDER* name where your players first logged in)")
|
@Comment("Which world's player data should be deleted?(Enter the world *FOLDER* name where your players first logged in)")
|
||||||
public static final Property<String> DELETE_PLAYER_DATA_WORLD = newProperty("3rdPartyFeature.captcha.purgeWorldFolderName","world");
|
public static final Property<String> DELETE_PLAYER_DATA_WORLD = newProperty("3rdPartyFeature.captcha.purgeWorldFolderName","world");
|
||||||
|
|
||||||
@Comment("Should we enable the new LoginLocationFix feature?")
|
|
||||||
public static final Property<Boolean> LOGIN_LOC_FIX = newProperty("3rdPartyFeature.fixes.loginLocationFix.enabled", false);
|
|
||||||
|
|
||||||
@Comment("Should we fix the location when players logged in the portal?")
|
@Comment("Should we fix the location when players logged in the portal?")
|
||||||
public static final Property<Boolean> LOGIN_LOC_FIX_SUB_PORTAL = newProperty("3rdPartyFeature.fixes.loginLocationFix.fixPortalStuck", false);
|
public static final Property<Boolean> LOGIN_LOC_FIX_SUB_PORTAL = newProperty("3rdPartyFeature.fixes.loginLocationFix.fixPortalStuck", false);
|
||||||
|
|
||||||
|
|||||||
@@ -5,22 +5,6 @@ import org.bukkit.entity.Player;
|
|||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
//
|
|
||||||
//public class TeleportUtils {
|
|
||||||
// public static void teleport(Player player, Location location) {
|
|
||||||
// try {
|
|
||||||
// Class<?> paperClass = Class.forName("com.destroystokyo.paper.PaperConfig");
|
|
||||||
// // Paper API is loaded, use teleportAsync
|
|
||||||
// Method teleportAsyncMethod = player.getClass().getMethod("teleportAsync", Location.class);
|
|
||||||
// teleportAsyncMethod.setAccessible(true);
|
|
||||||
// teleportAsyncMethod.invoke(player, location);
|
|
||||||
// } catch (ClassNotFoundException | InvocationTargetException | NoSuchMethodException | IllegalAccessException e) {
|
|
||||||
// // Paper API is not loaded, use normal teleport
|
|
||||||
// player.teleport(location);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
public class TeleportUtils {
|
public class TeleportUtils {
|
||||||
private static Method teleportAsyncMethod;
|
private static Method teleportAsyncMethod;
|
||||||
|
|
||||||
@@ -28,6 +12,7 @@ public class TeleportUtils {
|
|||||||
try {//Detect Paper class
|
try {//Detect Paper class
|
||||||
Class<?> paperClass = Class.forName("com.destroystokyo.paper.PaperConfig");
|
Class<?> paperClass = Class.forName("com.destroystokyo.paper.PaperConfig");
|
||||||
teleportAsyncMethod = Player.class.getMethod("teleportAsync", Location.class);
|
teleportAsyncMethod = Player.class.getMethod("teleportAsync", Location.class);
|
||||||
|
teleportAsyncMethod.setAccessible(true);
|
||||||
// if detected,use teleportAsync()
|
// if detected,use teleportAsync()
|
||||||
} catch (ClassNotFoundException | NoSuchMethodException e) {
|
} catch (ClassNotFoundException | NoSuchMethodException e) {
|
||||||
teleportAsyncMethod = null;
|
teleportAsyncMethod = null;
|
||||||
@@ -38,7 +23,6 @@ public class TeleportUtils {
|
|||||||
public static void teleport(Player player, Location location) {
|
public static void teleport(Player player, Location location) {
|
||||||
if (teleportAsyncMethod != null) {
|
if (teleportAsyncMethod != null) {
|
||||||
try {
|
try {
|
||||||
teleportAsyncMethod.setAccessible(true);
|
|
||||||
teleportAsyncMethod.invoke(player, location);
|
teleportAsyncMethod.invoke(player, location);
|
||||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||||
player.teleport(location);
|
player.teleport(location);
|
||||||
|
|||||||
@@ -103,7 +103,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p style="color:#b0adc5;">© 2023 HomoCraft. All rights reserved.</p>
|
<p style="color:#b0adc5;">© 2023 HomoCraft. All rights reserved.</p>
|
||||||
<a href="1919810.com" target="_blank" style="text-decoration: none; font-size: 16px">homomc.cc</a>
|
<a href="1919810.com" target="_blank"
|
||||||
|
style="text-decoration: none; font-size: 16px">wdsj.io</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -155,3 +155,28 @@ time:
|
|||||||
hours: 'hours'
|
hours: 'hours'
|
||||||
day: 'day'
|
day: 'day'
|
||||||
days: 'days'
|
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!'
|
||||||
|
|
||||||
|
# 3rd party features: Bedrock Auto Login
|
||||||
|
bedrock_auto_login:
|
||||||
|
success: '&aBedrock auto login success!'
|
||||||
|
|
||||||
|
# 3rd party features: Login Location Fix
|
||||||
|
login_location_fix:
|
||||||
|
fix_portal: '&aYou are stuck in portal during Login.'
|
||||||
|
fix_underground: '&aYou are stuck underground during Login.'
|
||||||
|
cannot_fix_underground: '&aYou are stuck underground during Login, but we cant fix it.'
|
||||||
|
|
||||||
|
# 3rd party features: Double Login Fix
|
||||||
|
double_login_fix:
|
||||||
|
fix_message: '&cYou have been disconnected due to doubled login.'
|
||||||
|
|||||||
@@ -164,3 +164,30 @@ two_factor:
|
|||||||
not_enabled_error: '&c双重验证未在您的账号上启用,请使用“/totp add”来启用'
|
not_enabled_error: '&c双重验证未在您的账号上启用,请使用“/totp add”来启用'
|
||||||
removed_success: '&c双重验证已从您的账号上禁用'
|
removed_success: '&c双重验证已从您的账号上禁用'
|
||||||
invalid_code: '&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验证超时'
|
||||||
|
|
||||||
|
# 3rd party features: Bedrock Auto Login
|
||||||
|
bedrock_auto_login:
|
||||||
|
success: "&a基岩版自动登录完成"
|
||||||
|
|
||||||
|
# 3rd party features: Login Location Fix
|
||||||
|
login_location_fix:
|
||||||
|
fix_portal: '&a你在登录时卡在了地狱门, 现已修正'
|
||||||
|
fix_underground: '&a你被埋住了, 坐标已修正, 下次下线之前请小心!'
|
||||||
|
cannot_fix_underground: '&a你被埋住了, 坐标无法修正, 只好送你去了最高点, 自求多福吧少年~'
|
||||||
|
|
||||||
|
# 3rd party features: Double Login Fix
|
||||||
|
double_login_fix:
|
||||||
|
fix_message: '&a已修复幽灵玩家, 请重新进入'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p style="color:#b0adc5;">© 2023 HomoCraft. All rights reserved.</p>
|
<p style="color:#b0adc5;">© 2023 HomoCraft. All rights reserved.</p>
|
||||||
<a href="1919810.com" target="_blank" style="text-decoration: none; font-size: 16px">homomc.cc</a>
|
<a href="1919810.com" target="_blank"
|
||||||
|
style="text-decoration: none; font-size: 16px">wdsj.io</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ authors: [${pluginDescription.authors}]
|
|||||||
website: http://github.com/HaHaWTH/AuthMeReReloaded/
|
website: http://github.com/HaHaWTH/AuthMeReReloaded/
|
||||||
description: A fork of AuthMeReloaded that contains bug fixes
|
description: A fork of AuthMeReloaded that contains bug fixes
|
||||||
main: ${pluginDescription.main}
|
main: ${pluginDescription.main}
|
||||||
version: 5.6.0-FORK-b27
|
version: 5.6.0-FORK-b34
|
||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
softdepend:
|
softdepend:
|
||||||
- Vault
|
- Vault
|
||||||
|
|||||||
@@ -102,7 +102,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p style="color:#b0adc5;">© 2023 HomoCraft. All rights reserved.</p>
|
<p style="color:#b0adc5;">© 2023 HomoCraft. All rights reserved.</p>
|
||||||
<a href="191980.com" target="_blank" style="text-decoration: none; font-size: 16px">homomc.cc</a>
|
<a href="1919810.com" target="_blank"
|
||||||
|
style="text-decoration: none; font-size: 16px">wdsj.io</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -100,7 +100,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p style="color:#b0adc5;">© 2023 HomoCraft. All rights reserved.</p>
|
<p style="color:#b0adc5;">© 2023 HomoCraft. All rights reserved.</p>
|
||||||
<a href="1919810.com" target="_blank" style="text-decoration: none; font-size: 16px">homomc.cc</a>
|
<a href="1919810.com" target="_blank"
|
||||||
|
style="text-decoration: none; font-size: 16px">wdsj.io</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@@ -102,7 +102,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<p style="color:#b0adc5;">© 2023 HomoCraft. All rights reserved.</p>
|
<p style="color:#b0adc5;">© 2023 HomoCraft. All rights reserved.</p>
|
||||||
<a href="1919810.com" target="_blank" style="text-decoration: none; font-size: 16px">homomc.cc</a>
|
<a href="1919810.com" target="_blank"
|
||||||
|
style="text-decoration: none; font-size: 16px">wdsj.io</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user