Remove all permission attachments when performing a manload or restart.

This commit is contained in:
ElgarL 2012-04-06 12:53:36 +01:00
parent bd7af593e7
commit 25bd91eb80
3 changed files with 14 additions and 1 deletions

View File

@ -165,3 +165,4 @@ v 2.0:
- Fix GM reporting of permission inheritance to retain the correct order. Lower inheritance groups can no longer negate a higher groups permissions. - Fix GM reporting of permission inheritance to retain the correct order. Lower inheritance groups can no longer negate a higher groups permissions.
- Fix an error I caused trying to modify an unmodifiable list when parsing '*' permissions. - Fix an error I caused trying to modify an unmodifiable list when parsing '*' permissions.
- Don't throw errors when attempting to remove permission attachments (bukkit will have already removed it). - Don't throw errors when attempting to remove permission attachments (bukkit will have already removed it).
- Remove all permission attachments when performing a manload or restart.

View File

@ -106,6 +106,9 @@ public class GroupManager extends JavaPlugin {
} }
WorldEvents = null; WorldEvents = null;
// Remove all attachments before clearing
BukkitPermissions.removeAllAttachments();
BukkitPermissions = null; BukkitPermissions = null;
// EXAMPLE: Custom code, here we just output some info so we can check that // EXAMPLE: Custom code, here we just output some info so we can check that

View File

@ -363,6 +363,15 @@ public class BukkitPermissions {
} }
} }
/**
* Remove all attachments in case of a restart or reload.
*/
public void removeAllAttachments() {
for (Player player : attachments.keySet())
removeAttachment(player);
}
/** /**
* Player events tracked to cause Superperms updates * Player events tracked to cause Superperms updates
* *