mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2026-11-24 09:24:24 +00:00
Remove the 'use-server-uuids' option and internal UuidCache system
The feature has stuck around since the early days - and solves a problem which really should never occur.
This commit is contained in:
28 files changed
+52
-304
No files matched your search
@@ -66,7 +66,6 @@ import me.lucko.luckperms.common.tasks.CacheHousekeepingTask;
|
||||
import me.lucko.luckperms.common.tasks.ExpireTemporaryTask;
|
||||
import me.lucko.luckperms.common.tasks.UpdateTask;
|
||||
import me.lucko.luckperms.common.treeview.PermissionVault;
|
||||
import me.lucko.luckperms.common.utils.UuidCache;
|
||||
import me.lucko.luckperms.common.verbose.VerboseHandler;
|
||||
import me.lucko.luckperms.sponge.calculators.SpongeCalculatorFactory;
|
||||
import me.lucko.luckperms.sponge.commands.SpongeMainCommand;
|
||||
@@ -173,7 +172,6 @@ public class LPSpongePlugin implements LuckPermsSpongePlugin {
|
||||
private Storage storage;
|
||||
private FileWatcher fileWatcher = null;
|
||||
private InternalMessagingService messagingService = null;
|
||||
private UuidCache uuidCache;
|
||||
private LuckPermsApiProvider apiProvider;
|
||||
private EventFactory eventFactory;
|
||||
private me.lucko.luckperms.common.logging.Logger log;
|
||||
@@ -243,7 +241,6 @@ public class LPSpongePlugin implements LuckPermsSpongePlugin {
|
||||
|
||||
// load internal managers
|
||||
getLog().info("Loading internal permission managers...");
|
||||
this.uuidCache = new UuidCache(this);
|
||||
this.userManager = new SpongeUserManager(this);
|
||||
this.groupManager = new SpongeGroupManager(this);
|
||||
this.trackManager = new StandardTrackManager(this);
|
||||
@@ -410,7 +407,7 @@ public class LPSpongePlugin implements LuckPermsSpongePlugin {
|
||||
return null;
|
||||
}
|
||||
|
||||
return this.game.getServer().getPlayer(this.uuidCache.getExternalUUID(user.getUuid())).orElse(null);
|
||||
return this.game.getServer().getPlayer(user.getUuid()).orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -580,11 +577,6 @@ public class LPSpongePlugin implements LuckPermsSpongePlugin {
|
||||
return this.storage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UuidCache getUuidCache() {
|
||||
return this.uuidCache;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LuckPermsApiProvider getApiProvider() {
|
||||
return this.apiProvider;
|
||||
|
||||
+1
-11
@@ -29,7 +29,6 @@ import me.lucko.luckperms.common.config.ConfigKeys;
|
||||
import me.lucko.luckperms.common.locale.Message;
|
||||
import me.lucko.luckperms.common.model.User;
|
||||
import me.lucko.luckperms.common.utils.AbstractLoginListener;
|
||||
import me.lucko.luckperms.common.utils.UuidCache;
|
||||
import me.lucko.luckperms.sponge.LPSpongePlugin;
|
||||
|
||||
import org.spongepowered.api.event.Listener;
|
||||
@@ -126,7 +125,7 @@ public class SpongeConnectionListener extends AbstractLoginListener {
|
||||
this.plugin.getLog().info("Processing login event for " + player.getUniqueId() + " - " + player.getName());
|
||||
}
|
||||
|
||||
final User user = this.plugin.getUserManager().getIfLoaded(this.plugin.getUuidCache().getUUID(player.getUniqueId()));
|
||||
final User user = this.plugin.getUserManager().getIfLoaded(player.getUniqueId());
|
||||
|
||||
/* User instance is null for whatever reason. Could be that it was unloaded between asyncpre and now. */
|
||||
if (user == null) {
|
||||
@@ -158,15 +157,6 @@ public class SpongeConnectionListener extends AbstractLoginListener {
|
||||
|
||||
@Listener(order = Order.POST)
|
||||
public void onClientLeave(ClientConnectionEvent.Disconnect e) {
|
||||
/* We don't actually remove the user instance here, as Sponge likes to keep performing checks
|
||||
on players when they disconnect. The instance gets cleared up on a housekeeping task
|
||||
after a period of inactivity. */
|
||||
|
||||
final UuidCache cache = this.plugin.getUuidCache();
|
||||
|
||||
// Unload the user from memory when they disconnect
|
||||
cache.clearCache(e.getTargetEntity().getUniqueId());
|
||||
|
||||
// Register with the housekeeper, so the User's instance will stick
|
||||
// around for a bit after they disconnect
|
||||
this.plugin.getUserManager().getHouseKeeper().registerUsage(e.getTargetEntity().getUniqueId());
|
||||
|
||||
@@ -87,7 +87,7 @@ public class SpongeUser extends User {
|
||||
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
return this.plugin.getUuidCache().getExternalUUID(this.parent.getUuid()).toString();
|
||||
return this.parent.getUuid().toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -97,7 +97,7 @@ public class SpongeUser extends User {
|
||||
|
||||
@Override
|
||||
public Optional<CommandSource> getCommandSource() {
|
||||
final UUID uuid = this.plugin.getUuidCache().getExternalUUID(this.parent.getUuid());
|
||||
final UUID uuid = this.parent.getUuid();
|
||||
return Sponge.getServer().getPlayer(uuid).map(Function.identity());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user