Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 778edac895 | |||
| 17d1cf1665 | |||
| 3f3671c95c | |||
| 52c06917c3 | |||
| b2ea5cbef8 | |||
| 99c7466b37 | |||
| e60c18d8a8 | |||
| 8c4da6288e | |||
| 1a73adf414 | |||
| cb76ae01e1 |
@@ -67,7 +67,7 @@
|
||||
<maven.minimumVersion>3.6.3</maven.minimumVersion>
|
||||
|
||||
<!-- Dependencies versions -->
|
||||
<spigot.version>1.20.4-R0.1-SNAPSHOT</spigot.version>
|
||||
<spigot.version>1.20.6-R0.1-SNAPSHOT</spigot.version>
|
||||
|
||||
<!-- Versioning properties -->
|
||||
<project.outputName>AuthMe</project.outputName>
|
||||
@@ -279,10 +279,6 @@
|
||||
</excludes>
|
||||
</artifactSet>
|
||||
<relocations>
|
||||
<relocation>
|
||||
<pattern>org.h2</pattern>
|
||||
<shadedPattern>fr.xephi.authme.libs.org.h2</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.apache.http</pattern>
|
||||
<shadedPattern>fr.xephi.authme.libs.org.apache.http</shadedPattern>
|
||||
@@ -291,18 +287,6 @@
|
||||
<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>
|
||||
@@ -353,10 +337,6 @@
|
||||
<pattern>com.google.gson</pattern>
|
||||
<shadedPattern>fr.xephi.authme.libs.com.google.gson</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.h2</pattern>
|
||||
<shadedPattern>fr.xephi.authme.libs.org.h2</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>org.apache.http</pattern>
|
||||
<shadedPattern>fr.xephi.authme.libs.org.apache.http</shadedPattern>
|
||||
@@ -365,18 +345,6 @@
|
||||
<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>
|
||||
@@ -491,6 +459,10 @@
|
||||
<pattern>org.apache.commons.validator</pattern>
|
||||
<shadedPattern>fr.xephi.authme.libs.org.apache.commons.validator</shadedPattern>
|
||||
</relocation>
|
||||
<relocation>
|
||||
<pattern>com.alessiodp.libby</pattern>
|
||||
<shadedPattern>fr.xephi.authme.libs.com.alessiodp.libby</shadedPattern>
|
||||
</relocation>
|
||||
</relocations>
|
||||
|
||||
<filters>
|
||||
@@ -637,6 +609,12 @@
|
||||
</snapshots>
|
||||
</repository>
|
||||
|
||||
<!-- Maven Central Snapshots Repository -->
|
||||
<repository>
|
||||
<id>maven-snapshots</id>
|
||||
<url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
|
||||
</repository>
|
||||
|
||||
<!-- Multiverse Repo -->
|
||||
<repository>
|
||||
<id>onarandombox-repo-releases</id>
|
||||
@@ -751,6 +729,14 @@
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Libby -->
|
||||
<dependency>
|
||||
<groupId>com.alessiodp.libby</groupId>
|
||||
<artifactId>libby-bukkit</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Database Connection Pool -->
|
||||
<dependency>
|
||||
<groupId>com.zaxxer</groupId>
|
||||
@@ -1173,7 +1159,7 @@
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>2.2.224</version>
|
||||
<scope>compile</scope>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -2,6 +2,7 @@ package fr.xephi.authme;
|
||||
|
||||
import ch.jalu.injector.Injector;
|
||||
import ch.jalu.injector.InjectorBuilder;
|
||||
import com.alessiodp.libby.BukkitLibraryManager;
|
||||
import com.github.Anon8281.universalScheduler.UniversalScheduler;
|
||||
import com.github.Anon8281.universalScheduler.scheduling.schedulers.TaskScheduler;
|
||||
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||
@@ -80,7 +81,7 @@ public class AuthMe extends JavaPlugin {
|
||||
// Version and build number values
|
||||
private static String pluginVersion = "5.6.0-Fork";
|
||||
private static final String pluginBuild = "b";
|
||||
private static String pluginBuildNumber = "48";
|
||||
private static String pluginBuildNumber = "49";
|
||||
// Private instances
|
||||
private EmailService emailService;
|
||||
private CommandHandler commandHandler;
|
||||
@@ -143,6 +144,11 @@ public class AuthMe extends JavaPlugin {
|
||||
return scheduler;
|
||||
}
|
||||
|
||||
/**
|
||||
* The library manager
|
||||
*/
|
||||
public static BukkitLibraryManager libraryManager;
|
||||
|
||||
/**
|
||||
* Method called when the server enables the plugin.
|
||||
*/
|
||||
@@ -151,6 +157,7 @@ public class AuthMe extends JavaPlugin {
|
||||
// Load the plugin version data from the plugin description file
|
||||
loadPluginInfo(getDescription().getVersion());
|
||||
scheduler = UniversalScheduler.getScheduler(this);
|
||||
libraryManager = new BukkitLibraryManager(this);
|
||||
|
||||
// Set the Logger instance and log file path
|
||||
ConsoleLogger.initialize(getLogger(), new File(getDataFolder(), LOG_FILENAME));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package fr.xephi.authme.initialization;
|
||||
|
||||
import com.alessiodp.libby.Library;
|
||||
import fr.xephi.authme.ConsoleLogger;
|
||||
import fr.xephi.authme.data.auth.PlayerCache;
|
||||
import fr.xephi.authme.datasource.CacheDataSource;
|
||||
@@ -21,6 +22,8 @@ import javax.inject.Provider;
|
||||
import java.io.File;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import static fr.xephi.authme.AuthMe.libraryManager;
|
||||
|
||||
/**
|
||||
* Creates the AuthMe data source.
|
||||
*/
|
||||
@@ -78,8 +81,14 @@ public class DataSourceProvider implements Provider<DataSource> {
|
||||
dataSource = new SQLite(settings, dataFolder);
|
||||
break;
|
||||
case H2:
|
||||
Library h2 = Library.builder()
|
||||
.groupId("com.h2database")
|
||||
.artifactId("h2")
|
||||
.version("2.2.224")
|
||||
.build();
|
||||
libraryManager.addMavenCentral();
|
||||
libraryManager.loadLibrary(h2);
|
||||
dataSource = new H2(settings, dataFolder);
|
||||
logger.warning("You are using H2 database, which is still in development!\nMake sure to backup and report any issues you encounter on GitHub!");
|
||||
break;
|
||||
default:
|
||||
throw new UnsupportedOperationException("Unknown data source type '" + dataSourceType + "'");
|
||||
|
||||
@@ -13,6 +13,7 @@ import fr.xephi.authme.service.bungeecord.BungeeSender;
|
||||
import fr.xephi.authme.service.bungeecord.MessageType;
|
||||
import fr.xephi.authme.service.velocity.VMessageType;
|
||||
import fr.xephi.authme.service.velocity.VelocitySender;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import javax.inject.Inject;
|
||||
@@ -64,11 +65,11 @@ public class AsynchronousLogout implements AsynchronousProcess {
|
||||
PlayerAuth auth = playerCache.getAuth(name);
|
||||
database.updateSession(auth);
|
||||
// TODO: send an update when a messaging service will be implemented (SESSION)
|
||||
//if (service.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) {
|
||||
if (service.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) {
|
||||
auth.setQuitLocation(player.getLocation());
|
||||
database.updateQuitLoc(auth);
|
||||
// TODO: send an update when a messaging service will be implemented (QUITLOC)
|
||||
//} AuthMeReReloaded - Always save quit location
|
||||
}
|
||||
|
||||
playerCache.removePlayer(name);
|
||||
codeManager.unverify(name);
|
||||
|
||||
@@ -12,6 +12,7 @@ import fr.xephi.authme.service.SessionService;
|
||||
import fr.xephi.authme.service.ValidationService;
|
||||
import fr.xephi.authme.settings.SpawnLoader;
|
||||
import fr.xephi.authme.settings.properties.PluginSettings;
|
||||
import fr.xephi.authme.settings.properties.RestrictionSettings;
|
||||
import fr.xephi.authme.util.PlayerUtils;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
@@ -67,16 +68,13 @@ public class AsynchronousQuit implements AsynchronousProcess {
|
||||
boolean wasLoggedIn = playerCache.isAuthenticated(name);
|
||||
|
||||
if (wasLoggedIn) {
|
||||
//if (service.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) {
|
||||
// AuthMeReReloaded - Always save quit location on quit
|
||||
if (service.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) {
|
||||
Location loc = spawnLoader.getPlayerLocationOrSpawn(player);
|
||||
PlayerAuth authLoc = PlayerAuth.builder()
|
||||
PlayerAuth auth = PlayerAuth.builder()
|
||||
.name(name).location(loc)
|
||||
.realName(player.getName()).build();
|
||||
database.updateQuitLoc(authLoc);
|
||||
// AuthMeReReloaded - Fix AuthMe#2769 -1
|
||||
//}
|
||||
|
||||
database.updateQuitLoc(auth);
|
||||
}
|
||||
|
||||
String ip = PlayerUtils.getPlayerIp(player);
|
||||
PlayerAuth auth = PlayerAuth.builder()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package fr.xephi.authme.process.quit;
|
||||
|
||||
import com.github.Anon8281.universalScheduler.UniversalScheduler;
|
||||
import fr.xephi.authme.data.limbo.LimboService;
|
||||
import fr.xephi.authme.process.SynchronousProcess;
|
||||
import fr.xephi.authme.settings.commandconfig.CommandManager;
|
||||
@@ -27,8 +28,10 @@ public class ProcessSyncPlayerQuit implements SynchronousProcess {
|
||||
commandManager.runCommandsOnLogout(player);
|
||||
} else {
|
||||
limboService.restoreData(player);
|
||||
if (!UniversalScheduler.isFolia) { // AuthMeReReloaded - Fix #146 (Very stupid solution, but works)
|
||||
player.saveData(); // #1238: Speed is sometimes not restored properly
|
||||
}
|
||||
}
|
||||
player.leaveVehicle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ public class AsynchronousUnregister implements AsynchronousProcess {
|
||||
public void adminUnregister(CommandSender initiator, String name, Player player) {
|
||||
if (dataSource.removeAuth(name)) {
|
||||
performPostUnregisterActions(name, player);
|
||||
velocitySender.sendAuthMeVelocityMessage(player, VMessageType.FORCE_UNREGISTER);
|
||||
if (player != null) velocitySender.sendAuthMeVelocityMessage(player, VMessageType.FORCE_UNREGISTER);
|
||||
bukkitService.createAndCallEvent(isAsync -> new UnregisterByAdminEvent(player, name, isAsync, initiator));
|
||||
if (initiator == null) {
|
||||
logger.info(name + " was unregistered");
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package fr.xephi.authme.service;
|
||||
|
||||
import com.github.Anon8281.universalScheduler.UniversalRunnable;
|
||||
import com.github.Anon8281.universalScheduler.UniversalScheduler;
|
||||
import com.github.Anon8281.universalScheduler.scheduling.tasks.MyScheduledTask;
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.initialization.SettingsDependent;
|
||||
import fr.xephi.authme.settings.Settings;
|
||||
import fr.xephi.authme.settings.properties.PluginSettings;
|
||||
import fr.xephi.authme.util.Utils;
|
||||
import org.bukkit.BanEntry;
|
||||
import org.bukkit.BanList;
|
||||
import org.bukkit.Bukkit;
|
||||
@@ -38,7 +38,7 @@ public class BukkitService implements SettingsDependent {
|
||||
/** Number of ticks per minute. */
|
||||
public static final int TICKS_PER_MINUTE = 60 * TICKS_PER_SECOND;
|
||||
/** Whether the server is running Folia. */
|
||||
private static final boolean IS_FOLIA = Utils.isClassLoaded("io.papermc.paper.threadedregions.RegionizedServer");
|
||||
private static final boolean isFolia = UniversalScheduler.isFolia;
|
||||
private final AuthMe authMe;
|
||||
private boolean useAsyncTasks;
|
||||
|
||||
@@ -68,7 +68,7 @@ public class BukkitService implements SettingsDependent {
|
||||
* @param delay Delay in server ticks before executing task
|
||||
*/
|
||||
public void scheduleSyncDelayedTask(Runnable task, long delay) {
|
||||
if (IS_FOLIA) {
|
||||
if (isFolia) {
|
||||
runTaskLater(task, delay);
|
||||
} else {
|
||||
Bukkit.getScheduler().runTaskLater(authMe, task, delay); // We must do this to keep compatibility
|
||||
@@ -98,7 +98,7 @@ public class BukkitService implements SettingsDependent {
|
||||
* @throws IllegalArgumentException if task is null
|
||||
*/
|
||||
public void runTask(Runnable task) {
|
||||
if (IS_FOLIA) {
|
||||
if (isFolia) {
|
||||
getScheduler().runTask(task);
|
||||
} else {
|
||||
Bukkit.getScheduler().runTask(authMe, task);
|
||||
@@ -106,7 +106,7 @@ public class BukkitService implements SettingsDependent {
|
||||
}
|
||||
|
||||
public void runTask(Entity entity, Runnable task) {
|
||||
if (IS_FOLIA) {
|
||||
if (isFolia) {
|
||||
getScheduler().runTask(entity, task);
|
||||
} else {
|
||||
Bukkit.getScheduler().runTask(authMe, task);
|
||||
@@ -122,7 +122,7 @@ public class BukkitService implements SettingsDependent {
|
||||
* @param task the task to be run
|
||||
*/
|
||||
public void runTaskIfFolia(Runnable task) {
|
||||
if (IS_FOLIA) {
|
||||
if (isFolia) {
|
||||
runTask(task);
|
||||
} else {
|
||||
task.run();
|
||||
@@ -134,7 +134,7 @@ public class BukkitService implements SettingsDependent {
|
||||
* @param task the task to be run
|
||||
*/
|
||||
public void runTaskIfFolia(Entity entity, Runnable task) {
|
||||
if (IS_FOLIA) {
|
||||
if (isFolia) {
|
||||
runTask(entity, task);
|
||||
} else {
|
||||
task.run();
|
||||
@@ -146,7 +146,7 @@ public class BukkitService implements SettingsDependent {
|
||||
* @param task the task to be run
|
||||
*/
|
||||
public void runTaskIfFolia(Location location, Runnable task) {
|
||||
if (IS_FOLIA) {
|
||||
if (isFolia) {
|
||||
runTask(location, task);
|
||||
} else {
|
||||
task.run();
|
||||
@@ -196,7 +196,7 @@ public class BukkitService implements SettingsDependent {
|
||||
* @throws IllegalArgumentException if task is null
|
||||
*/
|
||||
public void runTaskAsynchronously(Runnable task) {
|
||||
if (IS_FOLIA) {
|
||||
if (isFolia) {
|
||||
getScheduler().runTaskAsynchronously(task);
|
||||
} else {
|
||||
Bukkit.getScheduler().runTaskAsynchronously(authMe, task);
|
||||
|
||||
@@ -144,7 +144,9 @@ public class TeleportationService implements Reloadable {
|
||||
} else if (settings.getProperty(TELEPORT_UNAUTHED_TO_SPAWN)) {
|
||||
if (settings.getProperty(RestrictionSettings.SAVE_QUIT_LOCATION)) {
|
||||
Location location = buildLocationFromAuth(player, auth);
|
||||
if (location.equals(player.getLocation())) return;
|
||||
Location playerLoc = player.getLocation();
|
||||
if (location.getX() == playerLoc.getX() && location.getY() == location.getY() && location.getZ() == playerLoc.getZ()
|
||||
&& location.getWorld() == playerLoc.getWorld()) return;
|
||||
logger.debug("Teleporting `{0}` after login, based on the player auth", player.getName());
|
||||
teleportBackFromSpawn(player, location);
|
||||
} else if (limbo != null && limbo.getLocation() != null) {
|
||||
|
||||
@@ -4,7 +4,7 @@ website: http://github.com/HaHaWTH/AuthMeReReloaded/
|
||||
description: A fork of AuthMeReloaded that contains bug fixes
|
||||
main: ${pluginDescription.main}
|
||||
folia-supported: true
|
||||
version: 5.6.0-FORK-b48
|
||||
version: 5.6.0-FORK-b49
|
||||
api-version: 1.13
|
||||
softdepend:
|
||||
- Vault
|
||||
|
||||
Reference in New Issue
Block a user