Compare commits

..

25 Commits

Author SHA1 Message Date
HaHaWTH a18a6bd3a5 B45 release 2024-03-28 07:14:53 +08:00
HaHaWTH 2f5c423e53 Fiz 2024-03-28 06:12:05 +08:00
HaHaWTH ba1bc04b9c Fix 2024-03-28 06:08:48 +08:00
HaHaWTH 6d1790a02e Reverted 2024-03-28 05:53:52 +08:00
HaHaWTH 598c6736a6 Revert "Revert"
This reverts commit 01e46b566a.
2024-03-28 05:42:41 +08:00
HaHaWTH 44e4790e45 Revert "wtf"
This reverts commit 50219cc4a9.
2024-03-28 05:39:26 +08:00
HaHaWTH 409eb21b85 Revert "wtf 1"
This reverts commit b1c655bbc7.
2024-03-28 05:35:13 +08:00
HaHaWTH 54872f102d Fxxk 2024-03-28 04:56:52 +08:00
HaHaWTH b1c655bbc7 wtf 1 2024-03-28 04:41:42 +08:00
HaHaWTH 50219cc4a9 wtf 2024-03-28 04:33:36 +08:00
HaHaWTH 01e46b566a Revert 2024-03-28 03:51:46 +08:00
HaHaWTH 93c97cf94b Patch 2024-03-28 03:47:40 +08:00
HaHaWTH 8e9b580745 Debug 2 2024-03-28 02:32:58 +08:00
HaHaWTH 70104d73aa Debug 2024-03-28 02:21:54 +08:00
HaHaWTH aa3e56f98f Garbage 2024-03-28 02:17:21 +08:00
HaHaWTH eee560a7fe Garbage 2024-03-28 02:14:34 +08:00
HaHaWTH e8a1c33d40 Fix fix fix 2024-03-27 22:30:45 +08:00
HaHaWTH abeaa249b8 Revert "Some revert"
This reverts commit 797aadb328.
2024-03-27 22:13:17 +08:00
HaHaWTH 797905d050 Use fork version of UniversalScheduler 2024-03-27 21:47:14 +08:00
HaHaWTH 797aadb328 Some revert 2024-03-27 18:30:34 +08:00
HaHaWTH 4c918925d8 Fixed an upstream bug 2024-03-27 15:40:19 +08:00
HaHaWTH 640eb9335e Revert "Fix relocation"
This reverts commit 9b4b4634c3.
2024-03-27 13:55:37 +08:00
HaHaWTH cdce697ae6 Merge remote-tracking branch 'origin/master' 2024-03-27 12:04:45 +08:00
HaHaWTH ef85e2de25 Bug fix 2024-03-27 12:03:11 +08:00
DGun Otto 3128b821f4 [ci skip] enforce Java17 2024-03-27 00:15:30 +08:00
8 changed files with 26 additions and 73 deletions
+4 -48
View File
@@ -182,7 +182,7 @@
<version>${maven.minimumVersion}</version> <version>${maven.minimumVersion}</version>
</requireMavenVersion> </requireMavenVersion>
<requireJavaVersion> <requireJavaVersion>
<version>[11,)</version> <version>[17,)</version>
</requireJavaVersion> </requireJavaVersion>
</rules> </rules>
<fail>true</fail> <fail>true</fail>
@@ -323,7 +323,7 @@
</configuration> </configuration>
</execution> </execution>
<execution> <execution>
<id>shaded-jar-relocate</id> <id>shaded-jar-legacy</id>
<phase>package</phase> <phase>package</phase>
<goals> <goals>
<goal>shade</goal> <goal>shade</goal>
@@ -339,10 +339,6 @@
<pattern>com.google.thirdparty</pattern> <pattern>com.google.thirdparty</pattern>
<shadedPattern>fr.xephi.authme.libs.com.google.thirdparty</shadedPattern> <shadedPattern>fr.xephi.authme.libs.com.google.thirdparty</shadedPattern>
</relocation> </relocation>
<relocation>
<pattern>com.cryptomorin.xseries</pattern>
<shadedPattern>fr.xephi.authme.libs.xseries</shadedPattern>
</relocation>
<relocation> <relocation>
<pattern>com.google.j2objc</pattern> <pattern>com.google.j2objc</pattern>
<shadedPattern>fr.xephi.authme.libs.com.google.j2objc</shadedPattern> <shadedPattern>fr.xephi.authme.libs.com.google.j2objc</shadedPattern>
@@ -359,46 +355,6 @@
<pattern>org.h2</pattern> <pattern>org.h2</pattern>
<shadedPattern>fr.xephi.authme.libs.org.h2</shadedPattern> <shadedPattern>fr.xephi.authme.libs.org.h2</shadedPattern>
</relocation> </relocation>
<relocation>
<pattern>org.apache.http</pattern>
<shadedPattern>fr.xephi.authme.libs.org.apache.http</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons</pattern>
<shadedPattern>fr.xephi.authme.libs.org.apache.commons</shadedPattern>
</relocation>
<relocation>
<pattern>javax.activation</pattern>
<shadedPattern>fr.xephi.authme.libs.javax.activation</shadedPattern>
</relocation>
<relocation>
<pattern>javax.annotation</pattern>
<shadedPattern>fr.xephi.authme.libs.javax.annotation</shadedPattern>
</relocation>
<relocation>
<pattern>javax.mail</pattern>
<shadedPattern>fr.xephi.authme.libs.javax.mail</shadedPattern>
</relocation>
<relocation>
<pattern>waffle</pattern>
<shadedPattern>fr.xephi.authme.libs.waffle</shadedPattern>
</relocation>
<relocation>
<pattern>com.sun.mail</pattern>
<shadedPattern>fr.xephi.authme.libs.com.sun.mail</shadedPattern>
</relocation>
<relocation>
<pattern>com.sun.jna</pattern>
<shadedPattern>fr.xephi.authme.libs.com.sun.jna</shadedPattern>
</relocation>
<relocation>
<pattern>com.sun.activation</pattern>
<shadedPattern>fr.xephi.authme.libs.com.sun.activation</shadedPattern>
</relocation>
<relocation>
<pattern>com.github.benmanes.caffeine</pattern>
<shadedPattern>fr.xephi.authme.libs.com.github.benmanes.caffeine</shadedPattern>
</relocation>
</relocations> </relocations>
</configuration> </configuration>
</execution> </execution>
@@ -1170,9 +1126,9 @@
<!-- Universal Scheduler --> <!-- Universal Scheduler -->
<dependency> <dependency>
<groupId>com.github.Anon8281</groupId> <groupId>com.github.HomoMC</groupId>
<artifactId>UniversalScheduler</artifactId> <artifactId>UniversalScheduler</artifactId>
<version>0.1.6</version> <version>0.1.7</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
+2 -2
View File
@@ -79,7 +79,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 = "44"; private static String pluginBuildNumber = "45";
// Private instances // Private instances
private EmailService emailService; private EmailService emailService;
private CommandHandler commandHandler; private CommandHandler commandHandler;
@@ -405,7 +405,7 @@ public class AuthMe extends JavaPlugin {
} }
// Wait for tasks and close data source // Wait for tasks and close data source
new TaskCloser(this, database).run(); new TaskCloser(database).run();
// Disabled correctly // Disabled correctly
Consumer<String> infoLogMethod = logger == null ? getLogger()::info : logger::info; Consumer<String> infoLogMethod = logger == null ? getLogger()::info : logger::info;
@@ -24,7 +24,6 @@ public class LimboPlayer {
private final float flySpeed; private final float flySpeed;
private MyScheduledTask timeoutTask = null; private MyScheduledTask timeoutTask = null;
private MessageTask messageTask = null; private MessageTask messageTask = null;
private MyScheduledTask inter;
private LimboPlayerState state = LimboPlayerState.PASSWORD_REQUIRED; private LimboPlayerState state = LimboPlayerState.PASSWORD_REQUIRED;
@@ -114,19 +113,18 @@ public class LimboPlayer {
* *
* @param messageTask The message task to set * @param messageTask The message task to set
*/ */
public void setMessageTask(MessageTask messageTask, MyScheduledTask inter) { public void setMessageTask(MessageTask messageTask) {
if (this.messageTask != null && this.inter != null) { if (this.messageTask != null) {
this.inter.cancel(); this.messageTask.cancel();
} }
this.messageTask = messageTask; this.messageTask = messageTask;
this.inter = inter;
} }
/** /**
* Clears all tasks associated to the player. * Clears all tasks associated to the player.
*/ */
public void clearTasks() { public void clearTasks() {
setMessageTask(null, null); setMessageTask(null);
setTimeoutTask(null); setTimeoutTask(null);
} }
@@ -53,8 +53,8 @@ class LimboPlayerTaskManager {
if (interval > 0) { if (interval > 0) {
String[] joinMessage = messages.retrieveSingle(player, result.messageKey, result.args).split("\n"); String[] joinMessage = messages.retrieveSingle(player, result.messageKey, result.args).split("\n");
MessageTask messageTask = new MessageTask(player, joinMessage); MessageTask messageTask = new MessageTask(player, joinMessage);
MyScheduledTask task = bukkitService.runTaskTimer(messageTask, 2 * TICKS_PER_SECOND, (long) interval * TICKS_PER_SECOND); bukkitService.runTaskTimer(messageTask, 2 * TICKS_PER_SECOND, (long) interval * TICKS_PER_SECOND);
limbo.setMessageTask(messageTask, task); limbo.setMessageTask(messageTask);
} }
} }
@@ -4,8 +4,6 @@ import com.github.Anon8281.universalScheduler.scheduling.schedulers.TaskSchedule
import fr.xephi.authme.AuthMe; import fr.xephi.authme.AuthMe;
import fr.xephi.authme.datasource.DataSource; import fr.xephi.authme.datasource.DataSource;
import java.util.logging.Logger;
/** /**
* Waits for asynchronous tasks to complete before closing the data source * Waits for asynchronous tasks to complete before closing the data source
* so the plugin can shut down properly. * so the plugin can shut down properly.
@@ -13,20 +11,15 @@ import java.util.logging.Logger;
public class TaskCloser implements Runnable { public class TaskCloser implements Runnable {
private final TaskScheduler scheduler; private final TaskScheduler scheduler;
private final Logger logger;
private final AuthMe plugin;
private final DataSource dataSource; private final DataSource dataSource;
/** /**
* Constructor. * Constructor.
* *
* @param plugin the plugin instance
* @param dataSource the data source (nullable) * @param dataSource the data source (nullable)
*/ */
public TaskCloser(AuthMe plugin, DataSource dataSource) { public TaskCloser(DataSource dataSource) {
this.scheduler = AuthMe.getScheduler(); this.scheduler = AuthMe.getScheduler();
this.logger = plugin.getLogger();
this.plugin = plugin;
this.dataSource = dataSource; this.dataSource = dataSource;
} }
@@ -10,7 +10,7 @@ import static fr.xephi.authme.process.register.executors.PlayerAuthBuilderHelper
class PasswordRegisterExecutor extends AbstractPasswordRegisterExecutor<PasswordRegisterParams> { class PasswordRegisterExecutor extends AbstractPasswordRegisterExecutor<PasswordRegisterParams> {
@Override @Override
public PlayerAuth createPlayerAuthObject(PasswordRegisterParams params) { public synchronized PlayerAuth createPlayerAuthObject(PasswordRegisterParams params) {
return createPlayerAuth(params.getPlayer(), params.getHashedPassword(), params.getEmail()); return createPlayerAuth(params.getPlayer(), params.getHashedPassword(), params.getEmail());
} }
@@ -56,7 +56,7 @@ public class BukkitService implements SettingsDependent {
* @param task Task to be executed * @param task Task to be executed
*/ */
public void scheduleSyncDelayedTask(Runnable task) { public void scheduleSyncDelayedTask(Runnable task) {
getScheduler().runTask(task); runTask(task);
} }
/** /**
@@ -68,7 +68,11 @@ public class BukkitService implements SettingsDependent {
* @param delay Delay in server ticks before executing task * @param delay Delay in server ticks before executing task
*/ */
public void scheduleSyncDelayedTask(Runnable task, long delay) { public void scheduleSyncDelayedTask(Runnable task, long delay) {
getScheduler().runTaskLater(task, delay); if (IS_FOLIA) {
runTaskLater(task, delay);
} else {
Bukkit.getScheduler().runTaskLater(authMe, task, delay); // We must do this to keep compatibility
}
} }
/** /**
@@ -141,8 +145,6 @@ public class BukkitService implements SettingsDependent {
} }
} }
/** /**
* Returns a task that will run after the specified number of server * Returns a task that will run after the specified number of server
* ticks. * ticks.
@@ -182,7 +184,11 @@ public class BukkitService implements SettingsDependent {
* @throws IllegalArgumentException if task is null * @throws IllegalArgumentException if task is null
*/ */
public void runTaskAsynchronously(Runnable task) { public void runTaskAsynchronously(Runnable task) {
if (IS_FOLIA) {
getScheduler().runTaskAsynchronously(task); getScheduler().runTaskAsynchronously(task);
} else {
Bukkit.getScheduler().runTaskAsynchronously(authMe, task);
}
} }
/** /**
+1 -1
View File
@@ -4,7 +4,7 @@ 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}
folia-supported: true folia-supported: true
version: 5.6.0-FORK-b44 version: 5.6.0-FORK-b45
api-version: 1.13 api-version: 1.13
softdepend: softdepend:
- Vault - Vault