Compare commits
85 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ffdc4d2b6 | |||
| 44f9c75f41 | |||
| e0cc4e0790 | |||
| 1d9e1cb033 | |||
| e413760b32 | |||
| 72f0055c58 | |||
| 4260b9d1ec | |||
| 4eee83ca6f | |||
| 5cbbe5fc61 | |||
| a542a35eba | |||
| 00e34c21e1 | |||
| cf718a4cbd | |||
| 5b037221a7 | |||
| bee35c4ebf | |||
| 3c364edbe1 | |||
| 98fee693a4 | |||
| 2734c3e58e | |||
| 6d7c928197 | |||
| 0635e67e93 | |||
| b4df964d79 | |||
| 36e8f7691a | |||
| 94803c4ff1 | |||
| 4886e3464f | |||
| 352ab899d4 | |||
| 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 |
@@ -10,14 +10,19 @@ jobs:
|
|||||||
Build:
|
Build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
jdkversion: [11]
|
jdkversion: [ 11 ]
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-java@v3
|
- uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
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
|
||||||
|
|||||||
@@ -1,12 +1,16 @@
|
|||||||
# AuthMeReReloaded
|
# AuthMeReReloaded
|
||||||
**"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
|
||||||
2. Shutdown mail sending(When server is closed, email you)
|
2. Shutdown mail sending(When server is closed, email you)
|
||||||
3. Old bug fixes
|
3. Legacy 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)(based on UUID)
|
6. Bedrock Compatibility(Floodgate needed)(based on UUID)
|
||||||
@@ -15,7 +19,15 @@ MCBBS Link: [Click Here](https://www.mcbbs.net/forum.php?mod=viewthread&tid=1471
|
|||||||
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. Automatically login for Bedrock players(configurable)
|
||||||
|
16. 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!**
|
||||||
|
|||||||
@@ -531,6 +531,30 @@
|
|||||||
</snapshots>
|
</snapshots>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
|
<!-- Aliyun maven central repo -->
|
||||||
|
<repository>
|
||||||
|
<id>aliyun-repo</id>
|
||||||
|
<url>https://maven.aliyun.com/repository/public</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</repository>
|
||||||
|
|
||||||
|
<!-- Tencent cloud maven central repo -->
|
||||||
|
<repository>
|
||||||
|
<id>tencent-repo</id>
|
||||||
|
<url>https://mirrors.cloud.tencent.com/nexus/repository/maven-public/</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</repository>
|
||||||
|
|
||||||
<!-- CodeMC Repo (Contains many required libraries) -->
|
<!-- CodeMC Repo (Contains many required libraries) -->
|
||||||
<repository>
|
<repository>
|
||||||
<id>codemc-repo</id>
|
<id>codemc-repo</id>
|
||||||
@@ -598,6 +622,13 @@
|
|||||||
<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>
|
||||||
@@ -618,6 +649,10 @@
|
|||||||
<enabled>false</enabled>
|
<enabled>false</enabled>
|
||||||
</snapshots>
|
</snapshots>
|
||||||
</repository>
|
</repository>
|
||||||
|
<repository>
|
||||||
|
<id>opencollab-snapshot-main</id>
|
||||||
|
<url>https://repo.opencollab.dev/main/</url>
|
||||||
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@@ -625,7 +660,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.geysermc.floodgate</groupId>
|
<groupId>org.geysermc.floodgate</groupId>
|
||||||
<artifactId>api</artifactId>
|
<artifactId>api</artifactId>
|
||||||
<version>2.2.0-SNAPSHOT</version>
|
<version>2.2.2-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Jalu Injector -->
|
<!-- Jalu Injector -->
|
||||||
@@ -687,7 +722,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 +735,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>
|
||||||
|
|
||||||
@@ -1076,7 +1111,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.xerial</groupId>
|
<groupId>org.xerial</groupId>
|
||||||
<artifactId>sqlite-jdbc</artifactId>
|
<artifactId>sqlite-jdbc</artifactId>
|
||||||
<version>3.43.2.2</version>
|
<version>3.44.1.0</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -39,12 +39,9 @@ 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.event.HandlerList;
|
|
||||||
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;
|
||||||
@@ -77,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 = "31";
|
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;
|
||||||
@@ -180,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)) {
|
||||||
@@ -209,39 +204,16 @@ 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();
|
||||||
register3rdPartyListeners();
|
|
||||||
logger.info("GitHub: https://github.com/HaHaWTH/AuthMeReReloaded/");
|
logger.info("GitHub: https://github.com/HaHaWTH/AuthMeReReloaded/");
|
||||||
|
|
||||||
if (settings.getProperty(SecuritySettings.CHECK_FOR_UPDATES)) {
|
if (settings.getProperty(SecuritySettings.CHECK_FOR_UPDATES)) {
|
||||||
checkForUpdates();
|
checkForUpdates();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SHAEnabled) {
|
|
||||||
//shaChecker();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public File pluginfile = getFile();
|
|
||||||
|
|
||||||
private void register3rdPartyListeners() {
|
//Migrated
|
||||||
if (settings.getProperty(SecuritySettings.ANTI_GHOST_PLAYERS)) {
|
|
||||||
getServer().getPluginManager().registerEvents(new DoubleLoginFixListener((Plugin) this), this);
|
|
||||||
}
|
|
||||||
if (settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_UNDERGROUND) || settings.getProperty(SecuritySettings.LOGIN_LOC_FIX_SUB_PORTAL)) {
|
|
||||||
getServer().getPluginManager().registerEvents(new LoginLocationFixListener((Plugin) this), this);
|
|
||||||
}
|
|
||||||
// if (settings.getProperty(SecuritySettings.FORCE_LOGIN_BEDROCK) && settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) && getServer().getPluginManager().getPlugin("floodgate") != null) {
|
|
||||||
// getServer().getPluginManager().registerEvents(new BedrockAutoLoginListener((Plugin) this), this);
|
|
||||||
// }
|
|
||||||
// if (settings.getProperty(SecuritySettings.GUI_CAPTCHA) && getServer().getPluginManager().getPlugin("ProtocolLib") != null) {
|
|
||||||
// getServer().getPluginManager().registerEvents(new GuiCaptchaHandler((Plugin) this), this);
|
|
||||||
// logger.info("(Beta)GUICaptcha is enabled successfully!");
|
|
||||||
// logger.info("These features are still in early development, if you encountered any problem, please report.");
|
|
||||||
// } else if (settings.getProperty(SecuritySettings.GUI_CAPTCHA) && getServer().getPluginManager().getPlugin("ProtocolLib") == null) {
|
|
||||||
// logger.warning("ProtocolLib is not loaded, can't enable GUI Captcha.");
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Load the version and build number of the plugin from the description file.
|
* Load the version and build number of the plugin from the description file.
|
||||||
*
|
*
|
||||||
@@ -336,18 +308,6 @@ 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);
|
||||||
|
|
||||||
//Register 3rd party listeners
|
|
||||||
if (settings.getProperty(SecuritySettings.GUI_CAPTCHA) && getServer().getPluginManager().getPlugin("ProtocolLib") != null) {
|
|
||||||
pluginManager.registerEvents(injector.getSingleton(GuiCaptchaHandler.class), this);
|
|
||||||
logger.info("(Beta)GUICaptcha is enabled successfully!");
|
|
||||||
logger.info("These features are still in early development, if you encountered any problem, please report.");
|
|
||||||
} else if (settings.getProperty(SecuritySettings.GUI_CAPTCHA) && getServer().getPluginManager().getPlugin("ProtocolLib") == null) {
|
|
||||||
logger.warning("ProtocolLib is not loaded, can't enable GUI Captcha.");
|
|
||||||
}
|
|
||||||
if (settings.getProperty(SecuritySettings.FORCE_LOGIN_BEDROCK) && settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) && getServer().getPluginManager().getPlugin("floodgate") != null) {
|
|
||||||
pluginManager.registerEvents(injector.getSingleton(BedrockAutoLoginListener.class), this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Try to register 1.8+ player listeners
|
// 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")) {
|
||||||
@@ -355,8 +315,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
} 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);
|
||||||
// }
|
// }
|
||||||
@@ -370,6 +329,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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -410,18 +389,17 @@ public class AuthMe extends JavaPlugin {
|
|||||||
|
|
||||||
// Disabled correctly
|
// Disabled correctly
|
||||||
Consumer<String> infoLogMethod = logger == null ? getLogger()::info : logger::info;
|
Consumer<String> infoLogMethod = logger == null ? getLogger()::info : logger::info;
|
||||||
HandlerList.unregisterAll(this);
|
|
||||||
infoLogMethod.accept("AuthMe " + this.getDescription().getVersion() + " is unloaded successfully!");
|
infoLogMethod.accept("AuthMe " + this.getDescription().getVersion() + " is unloaded successfully!");
|
||||||
ConsoleLogger.closeFileWriter();
|
ConsoleLogger.closeFileWriter();
|
||||||
}
|
}
|
||||||
|
|
||||||
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");
|
||||||
@@ -437,8 +415,8 @@ 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.");
|
||||||
}
|
}
|
||||||
@@ -471,7 +449,7 @@ public class AuthMe extends JavaPlugin {
|
|||||||
private void checkServerType() {
|
private void checkServerType() {
|
||||||
if (isClassLoaded("com.destroystokyo.paper.PaperConfig")) {
|
if (isClassLoaded("com.destroystokyo.paper.PaperConfig")) {
|
||||||
logger.info("AuthMeReReloaded is running on Paper");
|
logger.info("AuthMeReReloaded is running on Paper");
|
||||||
}else if (isClassLoaded("catserver.server.CatServerConfig")) {
|
} else if (isClassLoaded("catserver.server.CatServerConfig")) {
|
||||||
logger.info("AuthMeReReloaded is running on CatServer");
|
logger.info("AuthMeReReloaded is running on CatServer");
|
||||||
} else if (isClassLoaded("org.spigotmc.SpigotConfig")) {
|
} else if (isClassLoaded("org.spigotmc.SpigotConfig")) {
|
||||||
logger.info("AuthMeReReloaded is running on Spigot");
|
logger.info("AuthMeReReloaded is running on Spigot");
|
||||||
@@ -481,72 +459,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 + "'");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,11 @@ 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.events.RestoreSessionEvent;
|
||||||
|
import fr.xephi.authme.message.MessageKey;
|
||||||
|
import fr.xephi.authme.message.Messages;
|
||||||
import fr.xephi.authme.service.BukkitService;
|
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.HooksSettings;
|
||||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -23,34 +27,36 @@ public class BedrockAutoLoginListener implements Listener {
|
|||||||
private BukkitService bukkitService;
|
private BukkitService bukkitService;
|
||||||
@Inject
|
@Inject
|
||||||
private AuthMe plugin;
|
private AuthMe plugin;
|
||||||
|
@Inject
|
||||||
|
private Messages messages;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private Settings settings;
|
||||||
|
|
||||||
public BedrockAutoLoginListener() {
|
public BedrockAutoLoginListener() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isBedrockPlayer(UUID uuid) {
|
private boolean isBedrockPlayer(UUID uuid) {
|
||||||
return AuthMe.settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) && AuthMe.settings.getProperty(SecuritySettings.FORCE_LOGIN_BEDROCK) && org.geysermc.floodgate.api.FloodgateApi.getInstance().isFloodgateId(uuid) && getServer().getPluginManager().getPlugin("floodgate") != null;
|
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.HIGHEST)
|
@EventHandler(priority = EventPriority.LOWEST)
|
||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
String name = event.getPlayer().getName();
|
String name = event.getPlayer().getName();
|
||||||
UUID uuid = event.getPlayer().getUniqueId();
|
UUID uuid = event.getPlayer().getUniqueId();
|
||||||
if (isBedrockPlayer(uuid) && !authmeApi.isAuthenticated(player) && authmeApi.isRegistered(name)) {
|
if (isBedrockPlayer(uuid) && !authmeApi.isAuthenticated(player) && authmeApi.isRegistered(name)) {
|
||||||
authmeApi.forceLogin(player);
|
authmeApi.forceLogin(player);
|
||||||
player.sendMessage("§a基岩版自动登录完成!");
|
messages.send(player, MessageKey.BEDROCK_AUTO_LOGGED_IN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* prevent sending duplicate messages */
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
// @EventHandler(priority = EventPriority.HIGHEST)
|
public void onPlayerAuthMeSessionRestore(RestoreSessionEvent event) {
|
||||||
// public void onPlayerRestoreSession(RestoreSessionEvent event) {
|
Player player = event.getPlayer();
|
||||||
// Player player = event.getPlayer();
|
UUID uuid = player.getUniqueId();
|
||||||
// String name = event.getPlayer().getName();
|
if (isBedrockPlayer(uuid)) {
|
||||||
// UUID uuid = event.getPlayer().getUniqueId();
|
event.setCancelled(true);
|
||||||
// if (isBedrockPlayer(uuid) && !authmeApi.isAuthenticated(player) && authmeApi.isRegistered(name)) {
|
}
|
||||||
// event.setCancelled(true);
|
}
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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());
|
||||||
|
|||||||
@@ -7,10 +7,12 @@ 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.events.LoginEvent;
|
||||||
import fr.xephi.authme.message.MessageKey;
|
import fr.xephi.authme.message.MessageKey;
|
||||||
import fr.xephi.authme.message.Messages;
|
import fr.xephi.authme.message.Messages;
|
||||||
import fr.xephi.authme.service.BukkitService;
|
import fr.xephi.authme.service.BukkitService;
|
||||||
import fr.xephi.authme.service.CommonService;
|
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;
|
||||||
@@ -22,6 +24,7 @@ import org.bukkit.event.EventPriority;
|
|||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||||
import org.bukkit.event.player.PlayerJoinEvent;
|
import org.bukkit.event.player.PlayerJoinEvent;
|
||||||
|
import org.bukkit.event.player.PlayerLoginEvent;
|
||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
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;
|
||||||
@@ -29,12 +32,14 @@ import org.bukkit.inventory.meta.ItemMeta;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
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 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;
|
||||||
@@ -51,34 +56,45 @@ public class GuiCaptchaHandler implements Listener {
|
|||||||
@Inject
|
@Inject
|
||||||
private CommonService service;
|
private CommonService service;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
private Settings settings;
|
||||||
|
|
||||||
|
|
||||||
private PacketAdapter chatPacketListener;
|
private PacketAdapter chatPacketListener;
|
||||||
private PacketAdapter windowPacketListener;
|
private PacketAdapter windowPacketListener;
|
||||||
|
|
||||||
//define timesLeft
|
//define timesLeft
|
||||||
private 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 = (howManyRandom.nextInt(3) + 1);
|
|
||||||
|
|
||||||
public GuiCaptchaHandler() {
|
public GuiCaptchaHandler() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private StringBuilder sb;
|
||||||
|
private final List<String> whiteList = AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_COUNTRY_WHITELIST);
|
||||||
|
|
||||||
private boolean isBedrockPlayer(UUID uuid) {
|
private boolean isBedrockPlayer(UUID uuid) {
|
||||||
return AuthMe.settings.getProperty(HooksSettings.HOOK_FLOODGATE_PLAYER) && AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_BE_COMPATIBILITY) && org.geysermc.floodgate.api.FloodgateApi.getInstance().isFloodgateId(uuid) && getServer().getPluginManager().getPlugin("floodgate") != null;
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removePacketListeners() {
|
|
||||||
ProtocolLibrary.getProtocolManager().removePacketListener(windowPacketListener);
|
private void initializePacketListeners() {
|
||||||
ProtocolLibrary.getProtocolManager().removePacketListener(chatPacketListener);
|
if (!isPacketListenersActive) {
|
||||||
|
ProtocolLibrary.getProtocolManager().addPacketListener(windowPacketListener);
|
||||||
|
ProtocolLibrary.getProtocolManager().addPacketListener(chatPacketListener);
|
||||||
|
isPacketListenersActive = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onInventoryClick(InventoryClickEvent event) {
|
public void onInventoryClick(InventoryClickEvent event) {
|
||||||
if (event.getWhoClicked() instanceof Player) {
|
if (event.getWhoClicked() instanceof Player) {
|
||||||
@@ -90,7 +106,9 @@ public class GuiCaptchaHandler implements Listener {
|
|||||||
}
|
}
|
||||||
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");
|
if (!closeReasonMap.containsKey(player)) {
|
||||||
|
closeReasonMap.put(player, "verified");
|
||||||
|
}
|
||||||
player.closeInventory();
|
player.closeInventory();
|
||||||
messages.send(player, MessageKey.GUI_CAPTCHA_VERIFIED);
|
messages.send(player, MessageKey.GUI_CAPTCHA_VERIFIED);
|
||||||
}
|
}
|
||||||
@@ -98,31 +116,47 @@ public class GuiCaptchaHandler implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
|
public void onPlayerLogin(PlayerLoginEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
bukkitService.runTaskAsynchronously(() -> {
|
||||||
|
sb = new StringBuilder();
|
||||||
|
int howLongIsRandomString = (howManyRandom.nextInt(3) + 1);
|
||||||
|
for (int i = 0; i < howLongIsRandomString; i++) {
|
||||||
|
//生成随机索引号
|
||||||
|
int index = randomItemSet.nextInt(randomSet.length());
|
||||||
|
|
||||||
|
// 从字符串中获取由索引 index 指定的字符
|
||||||
|
char randomChar = randomSet.charAt(index);
|
||||||
|
|
||||||
|
// 将字符追加到字符串生成器
|
||||||
|
sb.append(randomChar);
|
||||||
|
}
|
||||||
|
if (!whiteList.isEmpty()) {
|
||||||
|
String ip = getPlayerIp(player);
|
||||||
|
if (whiteList.contains(authmeApi.getCountryCode(ip)) && ip != null) {
|
||||||
|
if (!closeReasonMap.containsKey(player)) {
|
||||||
|
closeReasonMap.put(player, "verified:whitelist");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)
|
@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) && !isNpc(playerunreg)) {
|
if (!authmeApi.isRegistered(name) && !isNpc(playerunreg) && !closeReasonMap.containsKey(playerunreg)) {
|
||||||
if (isBedrockPlayer(playerunreg.getUniqueId())) {
|
if (isBedrockPlayer(playerunreg.getUniqueId())) {
|
||||||
closeReasonMap.put(playerunreg, "verified");
|
if (!closeReasonMap.containsKey(playerunreg)) {
|
||||||
|
closeReasonMap.put(playerunreg, "verified:bedrock");
|
||||||
|
}
|
||||||
messages.send(playerunreg, MessageKey.GUI_CAPTCHA_VERIFIED_AUTO_BEDROCK);
|
messages.send(playerunreg, MessageKey.GUI_CAPTCHA_VERIFIED_AUTO_BEDROCK);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bukkitService.runTaskAsynchronously(() -> {
|
bukkitService.runTaskAsynchronously(() -> {
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
howLongIsRandomString = (howManyRandom.nextInt(3) + 1);
|
|
||||||
for (int i = 0; i < howLongIsRandomString; i++) {
|
|
||||||
//生成随机索引号
|
|
||||||
int index = randomItemSet.nextInt(randomSet.length());
|
|
||||||
|
|
||||||
// 从字符串中获取由索引 index 指定的字符
|
|
||||||
char randomChar = randomSet.charAt(index);
|
|
||||||
|
|
||||||
// 将字符追加到字符串生成器
|
|
||||||
sb.append(randomChar);
|
|
||||||
}
|
|
||||||
|
|
||||||
bukkitService.runTask(() -> {
|
bukkitService.runTask(() -> {
|
||||||
randomString = sb.toString();
|
randomString = sb.toString();
|
||||||
Random random_blockpos = new Random();
|
Random random_blockpos = new Random();
|
||||||
@@ -138,16 +172,59 @@ public class GuiCaptchaHandler implements Listener {
|
|||||||
} 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.");
|
||||||
}
|
}
|
||||||
|
windowPacketListener = new PacketAdapter(this.plugin, ListenerPriority.HIGHEST, PacketType.Play.Client.CLOSE_WINDOW) {
|
||||||
|
@Override
|
||||||
|
public void onPacketReceiving(PacketEvent event) {
|
||||||
|
Player packetPlayer = event.getPlayer();
|
||||||
|
if (!closeReasonMap.containsKey(packetPlayer) && !authmeApi.isRegistered(packetPlayer.getName())) {
|
||||||
|
if (timesLeft <= 0) {
|
||||||
|
bukkitService.runTask(() -> {
|
||||||
|
packetPlayer.kickPlayer(service.retrieveSingleMessage(packetPlayer, MessageKey.GUI_CAPTCHA_KICK_FAILED));
|
||||||
|
});
|
||||||
|
timesLeft = 3;
|
||||||
|
} else {
|
||||||
|
--timesLeft;
|
||||||
|
if (timesLeft <= 0) {
|
||||||
|
bukkitService.runTask(() -> {
|
||||||
|
packetPlayer.kickPlayer(service.retrieveSingleMessage(packetPlayer, MessageKey.GUI_CAPTCHA_KICK_FAILED));
|
||||||
|
});
|
||||||
|
timesLeft = 3;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
messages.send(packetPlayer, 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);
|
||||||
|
packetPlayer.openInventory(menu);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
chatPacketListener = new PacketAdapter(this.plugin, ListenerPriority.HIGHEST, PacketType.Play.Client.CHAT) {
|
||||||
|
@Override
|
||||||
|
public void onPacketReceiving(PacketEvent event) {
|
||||||
|
Player packetPlayer = event.getPlayer();
|
||||||
|
if (!closeReasonMap.containsKey(packetPlayer) && !authmeApi.isRegistered(packetPlayer.getName())) {
|
||||||
|
messages.send(packetPlayer, MessageKey.GUI_CAPTCHA_DENIED_MESSAGE);
|
||||||
|
event.setCancelled(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
initializePacketListeners();
|
||||||
|
//Open captcha inventory
|
||||||
menu.setItem(random_num.get(), item);
|
menu.setItem(random_num.get(), item);
|
||||||
playerunreg.openInventory(menu);
|
playerunreg.openInventory(menu);
|
||||||
if (AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) > 0) {
|
if (settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) > 0) {
|
||||||
long timeOut = AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT);
|
long timeOut = settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT);
|
||||||
if (AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) > AuthMe.settings.getProperty(RestrictionSettings.TIMEOUT)) {
|
if (settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) > settings.getProperty(RestrictionSettings.TIMEOUT)) {
|
||||||
bukkitService.runTask(() -> {
|
bukkitService.runTask(() -> {
|
||||||
getLogger().warning("AuthMe detected that your GUI captcha timeout seconds(" + AuthMe.settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) + ") is bigger than the Login timeout seconds(" +
|
getLogger().warning("AuthMe detected that your GUI captcha timeout seconds(" + settings.getProperty(SecuritySettings.GUI_CAPTCHA_TIMEOUT) + ") is bigger than the Login timeout seconds(" +
|
||||||
AuthMe.settings.getProperty(RestrictionSettings.TIMEOUT) + "). To prevent issues, we will let the GUI captcha follow the Login timeout seconds, please check and modify your config.");
|
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;
|
||||||
bukkitService.runTask(() -> {
|
bukkitService.runTask(() -> {
|
||||||
@@ -159,61 +236,25 @@ public class GuiCaptchaHandler implements Listener {
|
|||||||
}, finalTimeOut * 20L);
|
}, finalTimeOut * 20L);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
bukkitService.runTask(() -> {
|
|
||||||
windowPacketListener = new PacketAdapter(this.plugin, ListenerPriority.HIGHEST, PacketType.Play.Client.CLOSE_WINDOW) {
|
|
||||||
@Override
|
|
||||||
public void onPacketReceiving(PacketEvent event) {
|
|
||||||
if (event.getPlayer() == playerunreg && !closeReasonMap.containsKey(playerunreg) && !authmeApi.isRegistered(playerunreg.getName())) {
|
|
||||||
if (timesLeft <= 0) {
|
|
||||||
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);
|
|
||||||
playerunreg.openInventory(menu);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
ProtocolLibrary.getProtocolManager().addPacketListener(windowPacketListener);
|
|
||||||
});
|
|
||||||
bukkitService.runTask(() -> {
|
|
||||||
chatPacketListener = new PacketAdapter(this.plugin, ListenerPriority.HIGHEST, PacketType.Play.Client.CHAT) {
|
|
||||||
@Override
|
|
||||||
public void onPacketReceiving(PacketEvent event) {
|
|
||||||
if (event.getPlayer() == playerunreg && !closeReasonMap.containsKey(playerunreg) && !authmeApi.isRegistered(playerunreg.getName())) {
|
|
||||||
messages.send(playerunreg, MessageKey.GUI_CAPTCHA_DENIED_MESSAGE);
|
|
||||||
event.setCancelled(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
ProtocolLibrary.getProtocolManager().addPacketListener(chatPacketListener);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//This prevents players from unregistering by Admins
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerAuthMeLogin(LoginEvent event) {
|
||||||
|
Player player = event.getPlayer();
|
||||||
|
if (!closeReasonMap.containsKey(player)) {
|
||||||
|
closeReasonMap.put(player, "verified:loggedIn");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
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");
|
||||||
|
|
||||||
@@ -228,7 +269,7 @@ 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");
|
||||||
// 构建玩家统计数据文件路径
|
// 构建玩家统计数据文件路径
|
||||||
@@ -239,24 +280,32 @@ public class GuiCaptchaHandler implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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)) {
|
||||||
closeReasonMap.remove(player);
|
|
||||||
bukkitService.runTaskLater(() -> {
|
bukkitService.runTaskLater(() -> {
|
||||||
if (!player.isOnline()) {
|
if (!player.isOnline()) {
|
||||||
deletePlayerData(playerUUID);
|
deletePlayerData(playerUUID);
|
||||||
deletePlayerStats(playerUUID);
|
deletePlayerStats(playerUUID);
|
||||||
|
deleteAuthMePlayerData(playerUUID);
|
||||||
}
|
}
|
||||||
}, 100L);
|
}, 100L);
|
||||||
removePacketListeners();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
removePacketListeners();
|
|
||||||
closeReasonMap.remove(player);
|
closeReasonMap.remove(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
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.Settings;
|
||||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||||
import fr.xephi.authme.util.TeleportUtils;
|
import fr.xephi.authme.util.TeleportUtils;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@@ -12,15 +16,20 @@ 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;
|
||||||
|
@Inject
|
||||||
|
private Settings settings;
|
||||||
private final AuthMeApi authmeApi = AuthMeApi.getInstance();
|
private final AuthMeApi authmeApi = AuthMeApi.getInstance();
|
||||||
|
|
||||||
public LoginLocationFixListener(Plugin plugin) {
|
public LoginLocationFixListener() {
|
||||||
this.plugin = plugin;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Material materialPortal = Material.matchMaterial("PORTAL");
|
private static Material materialPortal = Material.matchMaterial("PORTAL");
|
||||||
@@ -63,7 +72,7 @@ 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 (isFixGroundStuck) {
|
} 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();
|
||||||
@@ -86,7 +95,7 @@ public class LoginLocationFixListener implements Listener {
|
|||||||
} else {
|
} 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) {
|
||||||
@@ -95,7 +104,7 @@ public class LoginLocationFixListener implements Listener {
|
|||||||
} else {
|
} 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);
|
||||||
Bukkit.dispatchCommand(event.getPlayer(), "help");
|
if (settings.getProperty(PluginSettings.MENU_UNREGISTER_COMPATIBILITY)) {
|
||||||
|
Bukkit.dispatchCommand(event.getPlayer(), "help");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,31 @@ 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 {
|
||||||
|
/**
|
||||||
|
* 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
|
* %random Verification
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -150,6 +150,9 @@ public class MessageUpdater {
|
|||||||
.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("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
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import fr.xephi.authme.output.ConsoleLoggerFactory;
|
|||||||
import fr.xephi.authme.settings.Settings;
|
import fr.xephi.authme.settings.Settings;
|
||||||
import fr.xephi.authme.settings.SpawnLoader;
|
import fr.xephi.authme.settings.SpawnLoader;
|
||||||
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.util.TeleportUtils;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@@ -140,7 +142,7 @@ public class TeleportationService implements Reloadable {
|
|||||||
logger.debug("Teleporting `{0}` to spawn because of 'force-spawn after login'", player.getName());
|
logger.debug("Teleporting `{0}` to spawn because of 'force-spawn after login'", player.getName());
|
||||||
teleportToSpawn(player, true);
|
teleportToSpawn(player, true);
|
||||||
} else if (settings.getProperty(TELEPORT_UNAUTHED_TO_SPAWN)) {
|
} else if (settings.getProperty(TELEPORT_UNAUTHED_TO_SPAWN)) {
|
||||||
if (settings.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION) && auth.getQuitLocY() != 0) {
|
if (settings.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) {
|
||||||
Location location = buildLocationFromAuth(player, auth);
|
Location location = buildLocationFromAuth(player, auth);
|
||||||
logger.debug("Teleporting `{0}` after login, based on the player auth", player.getName());
|
logger.debug("Teleporting `{0}` after login, based on the player auth", player.getName());
|
||||||
teleportBackFromSpawn(player, location);
|
teleportBackFromSpawn(player, location);
|
||||||
@@ -184,7 +186,9 @@ public class TeleportationService implements Reloadable {
|
|||||||
private void performTeleportation(final Player player, final AbstractTeleportEvent event) {
|
private void performTeleportation(final Player player, final AbstractTeleportEvent event) {
|
||||||
bukkitService.scheduleSyncTaskFromOptionallyAsyncTask(() -> {
|
bukkitService.scheduleSyncTaskFromOptionallyAsyncTask(() -> {
|
||||||
bukkitService.callEvent(event);
|
bukkitService.callEvent(event);
|
||||||
if (player.isOnline() && isEventValid(event)) {
|
if (player.isOnline() && isEventValid(event) && settings.getProperty(SecuritySettings.SMART_ASYNC_TELEPORT)) {
|
||||||
|
TeleportUtils.teleport(player, event.getTo());
|
||||||
|
} else if (player.isOnline() && isEventValid(event)) {
|
||||||
player.teleport(event.getTo());
|
player.teleport(event.getTo());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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?",
|
||||||
|
|||||||
@@ -6,8 +6,10 @@ 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,11 @@ 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.features.captcha.whiteList");
|
||||||
|
|
||||||
@Comment({"Should we let Bedrock players login automatically?",
|
@Comment({"Should we let Bedrock players login automatically?",
|
||||||
"(Requires hookFloodgate to be true & floodgate loaded)"})
|
"(Requires hookFloodgate to be true & floodgate loaded)"})
|
||||||
public static final Property<Boolean> FORCE_LOGIN_BEDROCK = newProperty("3rdPartyFeature.features.bedrockAutoLogin", false);
|
public static final Property<Boolean> FORCE_LOGIN_BEDROCK = newProperty("3rdPartyFeature.features.bedrockAutoLogin", false);
|
||||||
@@ -31,21 +38,21 @@ public final class SecuritySettings implements SettingsHolder {
|
|||||||
public static final Property<Boolean> SMART_ASYNC_TELEPORT = newProperty("3rdPartyFeature.optimizes.smartAsyncTeleport", false);
|
public static final Property<Boolean> SMART_ASYNC_TELEPORT = newProperty("3rdPartyFeature.optimizes.smartAsyncTeleport", false);
|
||||||
|
|
||||||
@Comment("Send a GUI captcha to unregistered players?(Requires ProtocolLib)")
|
@Comment("Send a GUI captcha to unregistered players?(Requires ProtocolLib)")
|
||||||
public static final Property<Boolean> GUI_CAPTCHA = newProperty("3rdPartyFeature.captcha.guiCaptcha", false);
|
public static final Property<Boolean> GUI_CAPTCHA = newProperty("3rdPartyFeature.features.captcha.guiCaptcha", false);
|
||||||
|
|
||||||
@Comment({"Should we kick the players when they don't finish the GUI captcha in seconds?",
|
@Comment({"Should we kick the players when they don't finish the GUI captcha in seconds?",
|
||||||
"(less than or equals 0 is disabled)"})
|
"(less than or equals 0 is disabled)"})
|
||||||
public static final Property<Integer> GUI_CAPTCHA_TIMEOUT = newProperty("3rdPartyFeature.captcha.timeOut",0);
|
public static final Property<Integer> GUI_CAPTCHA_TIMEOUT = newProperty("3rdPartyFeature.features.captcha.timeOut", 0);
|
||||||
|
|
||||||
@Comment({"Should we ignore floodgate players when sending GUI captcha?",
|
@Comment({"Should we ignore floodgate players when sending GUI captcha?",
|
||||||
"(Requires floodgate and hookFloodgate: true)"})
|
"(Requires floodgate and hookFloodgate: true)"})
|
||||||
public static final Property<Boolean> GUI_CAPTCHA_BE_COMPATIBILITY = newProperty("3rdPartyFeature.captcha.ignoreBedrock",false);
|
public static final Property<Boolean> GUI_CAPTCHA_BE_COMPATIBILITY = newProperty("3rdPartyFeature.features.captcha.ignoreBedrock", false);
|
||||||
|
|
||||||
@Comment("Should we delete player data and stats when they didn't finish the captcha?")
|
@Comment("Should we delete player data and stats when they didn't finish the captcha?")
|
||||||
public static final Property<Boolean> DELETE_UNVERIFIED_PLAYER_DATA = newProperty("3rdPartyFeature.captcha.purgePlayerData",false);
|
public static final Property<Boolean> DELETE_UNVERIFIED_PLAYER_DATA = newProperty("3rdPartyFeature.features.captcha.purgePlayerData", false);
|
||||||
|
|
||||||
@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.features.captcha.purgeWorldFolderName", "world");
|
||||||
|
|
||||||
@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);
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package fr.xephi.authme.util;
|
||||||
|
|
||||||
|
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.geysermc.cumulus.form.CustomForm;
|
||||||
|
import org.geysermc.floodgate.api.FloodgateApi;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class FormUtils {
|
||||||
|
private static final FloodgateApi floodgateApi = FloodgateApi.getInstance();
|
||||||
|
private static final AuthMeApi authMeApi = AuthMeApi.getInstance();
|
||||||
|
|
||||||
|
public static void openRegisterForm(Player player, String title, String text, String textBar) {
|
||||||
|
String name = player.getName();
|
||||||
|
UUID uuid = player.getUniqueId();
|
||||||
|
CustomForm.Builder regForm = CustomForm.builder()
|
||||||
|
.title(title)
|
||||||
|
.input(text, textBar)
|
||||||
|
.validResultHandler(((customForm1, customFormResponse) -> {
|
||||||
|
authMeApi.registerPlayer(name, customFormResponse.asInput(0));
|
||||||
|
}));
|
||||||
|
floodgateApi.sendForm(uuid, regForm);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -166,3 +166,17 @@ gui_captcha:
|
|||||||
denied_message_sending: '&cPlease be verified before chatting!'
|
denied_message_sending: '&cPlease be verified before chatting!'
|
||||||
kick_on_failed: '&cPlease complete the verification!'
|
kick_on_failed: '&cPlease complete the verification!'
|
||||||
kick_on_timeout: '&cVerification timed out!'
|
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.'
|
||||||
|
|||||||
@@ -175,3 +175,19 @@ gui_captcha:
|
|||||||
denied_message_sending: '&c请先完成验证再聊天!'
|
denied_message_sending: '&c请先完成验证再聊天!'
|
||||||
kick_on_failed: '&c请先完成验证!'
|
kick_on_failed: '&c请先完成验证!'
|
||||||
kick_on_timeout: '&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-b31
|
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