Various small changes
This commit is contained in:
@@ -4,7 +4,6 @@ import lombok.Getter;
|
||||
import me.lucko.luckperms.api.implementation.ApiProvider;
|
||||
import me.lucko.luckperms.commands.CommandManager;
|
||||
import me.lucko.luckperms.data.Datastore;
|
||||
import me.lucko.luckperms.data.MySQLConfiguration;
|
||||
import me.lucko.luckperms.data.methods.FlatfileDatastore;
|
||||
import me.lucko.luckperms.data.methods.MySQLDatastore;
|
||||
import me.lucko.luckperms.groups.GroupManager;
|
||||
@@ -51,12 +50,7 @@ public class LPBungeePlugin extends Plugin implements LuckPermsPlugin {
|
||||
final String storageMethod = configuration.getStorageMethod();
|
||||
if (storageMethod.equalsIgnoreCase("mysql")) {
|
||||
getLogger().info("Using MySQL as storage method.");
|
||||
datastore = new MySQLDatastore(this, new MySQLConfiguration(
|
||||
configuration.getDatabaseValue("address"),
|
||||
configuration.getDatabaseValue("database"),
|
||||
configuration.getDatabaseValue("username"),
|
||||
configuration.getDatabaseValue("password")
|
||||
));
|
||||
datastore = new MySQLDatastore(this, configuration.getDatabaseValues());
|
||||
} else if (storageMethod.equalsIgnoreCase("flatfile")) {
|
||||
getLogger().info("Using Flatfile (JSON) as storage method.");
|
||||
datastore = new FlatfileDatastore(this, getDataFolder());
|
||||
|
||||
@@ -34,6 +34,7 @@ public class PlayerListener implements Listener {
|
||||
Offline mode. */
|
||||
e.registerIntent(plugin);
|
||||
plugin.doAsync(() -> {
|
||||
final long startTime = System.currentTimeMillis();
|
||||
final UuidCache cache = plugin.getUuidCache();
|
||||
final PendingConnection c = e.getConnection();
|
||||
|
||||
@@ -54,6 +55,10 @@ public class PlayerListener implements Listener {
|
||||
// We have to make a new user on this thread whilst the connection is being held, or we get concurrency issues as the Bukkit server
|
||||
// and the BungeeCord server try to make a new user at the same time.
|
||||
plugin.getDatastore().loadOrCreateUser(cache.getUUID(c.getUniqueId()), c.getName());
|
||||
final long time = System.currentTimeMillis() - startTime;
|
||||
if (time >= 1000) {
|
||||
plugin.getLogger().warning("Processing login for " + c.getName() + " took " + time + "ms.");
|
||||
}
|
||||
e.completeIntent(plugin);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user