diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/listeners/BukkitConnectionListener.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/listeners/BukkitConnectionListener.java index 710ae39e..92c339ca 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/listeners/BukkitConnectionListener.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/listeners/BukkitConnectionListener.java @@ -202,6 +202,14 @@ public class BukkitConnectionListener extends AbstractLoginListener implements L // Register with the housekeeper, so the User's instance will stick // around for a bit after they disconnect this.plugin.getUserManager().getHouseKeeper().registerUsage(player.getUniqueId()); + + // force a clear of transient nodes + this.plugin.getScheduler().doAsync(() -> { + User user = this.plugin.getUserManager().getIfLoaded(player.getUniqueId()); + if (user != null) { + user.clearTransientNodes(); + } + }); } } diff --git a/bungee/src/main/java/me/lucko/luckperms/bungee/listeners/BungeeConnectionListener.java b/bungee/src/main/java/me/lucko/luckperms/bungee/listeners/BungeeConnectionListener.java index b8b161d3..7a2d12ff 100644 --- a/bungee/src/main/java/me/lucko/luckperms/bungee/listeners/BungeeConnectionListener.java +++ b/bungee/src/main/java/me/lucko/luckperms/bungee/listeners/BungeeConnectionListener.java @@ -132,9 +132,19 @@ public class BungeeConnectionListener extends AbstractLoginListener implements L // Wait until the last priority to unload, so plugins can still perform permission checks on this event @EventHandler(priority = EventPriority.HIGHEST) public void onPlayerQuit(PlayerDisconnectEvent e) { + ProxiedPlayer player = e.getPlayer(); + // Register with the housekeeper, so the User's instance will stick // around for a bit after they disconnect - this.plugin.getUserManager().getHouseKeeper().registerUsage(e.getPlayer().getUniqueId()); + this.plugin.getUserManager().getHouseKeeper().registerUsage(player.getUniqueId()); + + // force a clear of transient nodes + this.plugin.getScheduler().doAsync(() -> { + User user = this.plugin.getUserManager().getIfLoaded(player.getUniqueId()); + if (user != null) { + user.clearTransientNodes(); + } + }); } } diff --git a/sponge/src/main/java/me/lucko/luckperms/sponge/listeners/SpongeConnectionListener.java b/sponge/src/main/java/me/lucko/luckperms/sponge/listeners/SpongeConnectionListener.java index d768bc62..9c0aeb3c 100644 --- a/sponge/src/main/java/me/lucko/luckperms/sponge/listeners/SpongeConnectionListener.java +++ b/sponge/src/main/java/me/lucko/luckperms/sponge/listeners/SpongeConnectionListener.java @@ -31,6 +31,7 @@ import me.lucko.luckperms.common.model.User; import me.lucko.luckperms.common.utils.AbstractLoginListener; import me.lucko.luckperms.sponge.LPSpongePlugin; +import org.spongepowered.api.entity.living.player.Player; import org.spongepowered.api.event.Listener; import org.spongepowered.api.event.Order; import org.spongepowered.api.event.filter.IsCancelled; @@ -157,9 +158,19 @@ public class SpongeConnectionListener extends AbstractLoginListener { @Listener(order = Order.POST) public void onClientLeave(ClientConnectionEvent.Disconnect e) { + Player player = e.getTargetEntity(); + // 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()); + this.plugin.getUserManager().getHouseKeeper().registerUsage(player.getUniqueId()); + + // force a clear of transient nodes + this.plugin.getScheduler().doAsync(() -> { + User user = this.plugin.getUserManager().getIfLoaded(player.getUniqueId()); + if (user != null) { + user.clearTransientNodes(); + } + }); } }