mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-05-19 22:03:26 +00:00
Prevent getAllPlayersPermissions() processing a group more than once.
Improves performance when using complex inheritance structures.
This commit is contained in:
parent
a0103afde3
commit
76ba5caeec
2 changed files with 27 additions and 19 deletions
|
@ -135,3 +135,4 @@ v 1.9:
|
|||
- Track the 'onPlayerChangeWorld' event as some teleports seem to not be triggering a world move.
|
||||
- Catch all errors in badly formatted groups.
|
||||
- Fix a bug with getWorldData return the main world data for all mirrors, instead of the worlds parent data.
|
||||
- Prevent getAllPlayersPermissions() processing a group more than once. Improves performance when using complex inheritance structures.
|
|
@ -121,8 +121,14 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
|
|||
// Add the players own permissions.
|
||||
playerPermArray.addAll(populatePerms(ph.getUser(userName).getPermissionList(), includeChildren));
|
||||
|
||||
ArrayList<String> alreadyProcessed = new ArrayList<String>();
|
||||
|
||||
// fetch all group permissions
|
||||
for (String group : getGroups(userName)) {
|
||||
// Don't process a group more than once.
|
||||
if (!alreadyProcessed.contains(group)) {
|
||||
alreadyProcessed.add(group);
|
||||
|
||||
Set<String> groupPermArray = new HashSet<String>();
|
||||
|
||||
if (group.startsWith("g:") && GroupManager.getGlobalGroups().hasGroup(group)) {
|
||||
|
@ -143,6 +149,7 @@ public class AnjoPermissionsHandler extends PermissionsReaderInterface {
|
|||
|| (negated && !playerPermArray.contains(perm.substring(1))))
|
||||
playerPermArray.add(perm);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// Collections.sort(playerPermArray, StringPermissionComparator.getInstance());
|
||||
|
|
Loading…
Reference in a new issue