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:
Luck
2018-01-21 20:18:13 +00:00
Unverified
parent 4c3e28ba85
commit 72d4e5cf7a
28 changed files with 52 additions and 304 deletions
@@ -80,7 +80,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 org.bukkit.command.PluginCommand;
@@ -120,7 +119,6 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin {
private Storage storage;
private FileWatcher fileWatcher = null;
private InternalMessagingService messagingService = null;
private UuidCache uuidCache;
private LuckPermsApiProvider apiProvider;
private EventFactory eventFactory;
private Logger log;
@@ -238,7 +236,6 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin {
// load internal managers
getLog().info("Loading internal permission managers...");
this.uuidCache = new UuidCache(this);
this.userManager = new StandardUserManager(this);
this.groupManager = new StandardGroupManager(this);
this.trackManager = new StandardTrackManager(this);
@@ -318,7 +315,7 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin {
this.scheduler.doAsync(() -> {
try {
connectionListener.loadUser(player.getUniqueId(), player.getName());
User user = getUserManager().getIfLoaded(getUuidCache().getUUID(player.getUniqueId()));
User user = getUserManager().getIfLoaded(player.getUniqueId());
if (user != null) {
this.scheduler.doSync(() -> {
try {
@@ -363,7 +360,7 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin {
player.setOp(false);
}
final User user = getUserManager().getIfLoaded(getUuidCache().getUUID(player.getUniqueId()));
final User user = getUserManager().getIfLoaded(player.getUniqueId());
if (user != null) {
user.getCachedData().invalidateCaches();
getUserManager().unload(user);
@@ -496,7 +493,7 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin {
@Override
public Player getPlayer(User user) {
return getServer().getPlayer(this.uuidCache.getExternalUUID(user.getUuid()));
return getServer().getPlayer(user.getUuid());
}
@Override
@@ -615,11 +612,6 @@ public class LPBukkitPlugin extends JavaPlugin implements LuckPermsPlugin {
return this.storage;
}
@Override
public UuidCache getUuidCache() {
return this.uuidCache;
}
@Override
public LuckPermsApiProvider getApiProvider() {
return this.apiProvider;
@@ -129,7 +129,7 @@ public class BukkitConnectionListener extends AbstractLoginListener implements L
this.plugin.getLog().info("Processing login 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) {
@@ -246,7 +246,7 @@ public class VaultChatHook extends AbstractVaultChat {
// utility methods for getting user and group instances
private User getUser(UUID uuid) {
return this.plugin.getUserManager().getIfLoaded(this.plugin.getUuidCache().getUUID(uuid));
return this.plugin.getUserManager().getIfLoaded(uuid);
}
private Group getGroup(String name) {
@@ -287,7 +287,7 @@ public class VaultPermissionHook extends AbstractVaultPermission {
// utility methods for getting user and group instances
private User getUser(UUID uuid) {
return this.plugin.getUserManager().getIfLoaded(this.plugin.getUuidCache().getUUID(uuid));
return this.plugin.getUserManager().getIfLoaded(uuid);
}
private Group getGroup(String name) {
-28
View File
@@ -38,34 +38,6 @@ apply-global-groups: true
# If users on this server should have global (non-world specific) groups applied
apply-global-world-groups: true
# If UUIDs should be pulled from the server, or looked up by username based upon previous
# connections.
#
# This option should be set to true in most cases. When set to false, in order to get a player's
# UUID, LuckPerms will:
#
# 1. Check if a player with the given username has joined before, if they have, use the UUID they
# used on their previous login.
# 2. Save and return the players "current" uuid.
#
# For offline mode (cracked) servers, a players UUID is generated based upon their username.
#
# IMPORTANT:
# If you are using BungeeCord proxy running in online mode, it is important that "online-mode=false"
# is set in server.properties, but "bungeecord: true" is set in the spigot.yml. You also need to set
# "ip_forward: true" in BungeeCord's config.yml.
#
# If for whatever reason you are not able to do this, and do not have ip-forward enabled, then you
# may need to set "use-server-uuids" to false.
#
# If your proxy is running in offline mode, you should still be setting up ip-forwarding as
# described above, but may also find that you need to set "bungee-online-mode" to false in
# paper.yml, if you are using Paper. (https://ci.destroystokyo.com/job/PaperSpigot/)
#
# This option only really exists for networks who for whatever reason cannot setup proper ip
# forwarding.
use-server-uuids: true
# If the servers own UUID cache/lookup facility should be used when there is no record for a player
# in the LuckPerms cache.
use-server-uuid-cache: false