mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 11:14:44 +02:00
SQLDatabaseManager optimizations, async profile loading -t00thpick1, zreed
This commit changes our shared connection into a connection pool utility to prevent thread locks from multiple actions attempting to access the database at the same time. In additon, profile loading has been moved off the main thread at login time, to allieviate the performance issues caused by it. Fixes #2138, Fixes #2119, Fixes #1982, Fixes #1953
This commit is contained in:
@ -930,7 +930,7 @@ public final class ExperienceAPI {
|
||||
}
|
||||
|
||||
private static PlayerProfile getOfflineProfile(UUID uuid) {
|
||||
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(uuid, false);
|
||||
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(uuid);
|
||||
|
||||
if (!profile.isLoaded()) {
|
||||
throw new InvalidPlayerException();
|
||||
@ -942,7 +942,7 @@ public final class ExperienceAPI {
|
||||
@Deprecated
|
||||
private static PlayerProfile getOfflineProfile(String playerName) {
|
||||
UUID uuid = mcMMO.p.getServer().getOfflinePlayer(playerName).getUniqueId();
|
||||
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(uuid, false);
|
||||
PlayerProfile profile = mcMMO.getDatabaseManager().loadPlayerProfile(uuid);
|
||||
|
||||
if (!profile.isLoaded()) {
|
||||
throw new InvalidPlayerException();
|
||||
|
Reference in New Issue
Block a user