Detach from permissible objects with a 1 tick delay after player quit to allow plugins listening on monitor to still access data (#1220)
This commit is contained in:
+1
-13
@@ -138,19 +138,7 @@ public class BungeeConnectionListener extends AbstractConnectionListener impleme
|
||||
// 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(player.getUniqueId());
|
||||
|
||||
// force a clear of transient nodes
|
||||
this.plugin.getBootstrap().getScheduler().executeAsync(() -> {
|
||||
User user = this.plugin.getUserManager().getIfLoaded(player.getUniqueId());
|
||||
if (user != null) {
|
||||
user.clearTransientNodes();
|
||||
}
|
||||
});
|
||||
handleDisconnect(e.getPlayer().getUniqueId());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -63,7 +63,7 @@ public class BungeePermissionCheckListener implements Listener {
|
||||
User user = this.plugin.getUserManager().getIfLoaded(player.getUniqueId());
|
||||
if (user == null) {
|
||||
e.setHasPermission(false);
|
||||
return;
|
||||
throw new IllegalStateException("No permissions data present for player: " + player.getName() + " - " + player.getUniqueId());
|
||||
}
|
||||
|
||||
Contexts contexts = this.plugin.getContextManager().getApplicableContexts(player);
|
||||
@@ -89,7 +89,7 @@ public class BungeePermissionCheckListener implements Listener {
|
||||
User user = this.plugin.getUserManager().getIfLoaded(player.getUniqueId());
|
||||
if (user == null) {
|
||||
e.setResult(Tristate.UNDEFINED);
|
||||
return;
|
||||
throw new IllegalStateException("No permissions data present for player: " + player.getName() + " - " + player.getUniqueId());
|
||||
}
|
||||
|
||||
Contexts contexts = this.plugin.getContextManager().getApplicableContexts(player);
|
||||
|
||||
Reference in New Issue
Block a user