I'm using parent groups on my server, nesting them down in a chain. Example:
"default" is the parent of "vip"
"vip" is the parent of "elite"
My permissions I add always filter down the chain, such that if I want to add a permission to "vip", I always intend for "elite" and any subsequent child groups to get the permission as well. It makes permission management a little easier, until I got to RUD permissions.
If I want to increase the percentage chance that a player gets their stuff back for vip players and even more for elite players, this currently doesn't work with nested parent/child groups. It looks like this code is grabbing the first % it sees and returning that:
What's happening now is that everyone gets the % chance for the "default" group, even if they are vip or elite.
"default" is the parent of "vip"
"vip" is the parent of "elite"
My permissions I add always filter down the chain, such that if I want to add a permission to "vip", I always intend for "elite" and any subsequent child groups to get the permission as well. It makes permission management a little easier, until I got to RUD permissions.
If I want to increase the percentage chance that a player gets their stuff back for vip players and even more for elite players, this currently doesn't work with nested parent/child groups. It looks like this code is grabbing the first % it sees and returning that:
private Dictionary<ContainerType, float> GetLossPercentage(ulong playerId)I think what needs to happen for this to account for nested groups is not return until all the values have been gathered (probably into an array) and then return the highest value.
{
foreach(var perm in permToContainer)
{
if (permission.UserHasPermission(playerId.ToString(), perm.Key))
return perm.Value;
}
return null;
}
What's happening now is that everyone gets the % chance for the "default" group, even if they are vip or elite.