Patch
This commit is contained in:
parent
8e9b580745
commit
93c97cf94b
@ -6,6 +6,7 @@ import com.github.Anon8281.universalScheduler.UniversalScheduler;
|
|||||||
import com.github.Anon8281.universalScheduler.scheduling.schedulers.TaskScheduler;
|
import com.github.Anon8281.universalScheduler.scheduling.schedulers.TaskScheduler;
|
||||||
import fr.xephi.authme.api.v3.AuthMeApi;
|
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||||
import fr.xephi.authme.command.CommandHandler;
|
import fr.xephi.authme.command.CommandHandler;
|
||||||
|
import fr.xephi.authme.command.TabCompleteHandler;
|
||||||
import fr.xephi.authme.datasource.DataSource;
|
import fr.xephi.authme.datasource.DataSource;
|
||||||
import fr.xephi.authme.initialization.DataFolder;
|
import fr.xephi.authme.initialization.DataFolder;
|
||||||
import fr.xephi.authme.initialization.DataSourceProvider;
|
import fr.xephi.authme.initialization.DataSourceProvider;
|
||||||
@ -57,6 +58,7 @@ import java.net.HttpURLConnection;
|
|||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@ -208,8 +210,8 @@ public class AuthMe extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
//detect server brand with classloader
|
//detect server brand with classloader
|
||||||
checkServerType();
|
checkServerType();
|
||||||
// Objects.requireNonNull(getCommand("register")).setTabCompleter(new TabCompleteHandler());
|
Objects.requireNonNull(getCommand("register")).setTabCompleter(new TabCompleteHandler());
|
||||||
// Objects.requireNonNull(getCommand("login")).setTabCompleter(new TabCompleteHandler());
|
Objects.requireNonNull(getCommand("login")).setTabCompleter(new TabCompleteHandler());
|
||||||
logger.info("AuthMeReReloaded is enabled successfully!");
|
logger.info("AuthMeReReloaded is enabled successfully!");
|
||||||
// Purge on start if enabled
|
// Purge on start if enabled
|
||||||
PurgeService purgeService = injector.getSingleton(PurgeService.class);
|
PurgeService purgeService = injector.getSingleton(PurgeService.class);
|
||||||
@ -403,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;
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user