Zrips / CMI

114 stars 97 forks source link

cmi.rank.rankname does not work for Donator/Staff ranks that inherit all other ranks. #6520

Open TomLewis opened 2 years ago

TomLewis commented 2 years ago

There's a bit of a design flaw with cmi.rank.rankname when it comes to setting the default starting rank if you are a temporary donator or staff member that inherits all previous permanent ranks, because this will just set you to the last CMI rank as its inherited.

All players have 2 groups, 1 of the 8 groups they can "rank up" to, and then if they a contributor/staff that aswell.

Here is a diagram to visualize my structure.

So a user may have both Sailor and Captain, or a user could just be Sailor, or a user could be Boatswain and Lieutenant. Copy of PirateCraft Ranks

Currently if a user is deckhand -> Quatermaster, the permission cmi.rank.rankname works flawlessly, the issue is when a user is a donator or staff role because they inherit all ranks from their Donator/Staff role aswell as them having a rank group.

If I remove the permissions cmi.rank.rankname from the lieutenant donator role, then the cmi ranking sees them as a deckhand, even if they are a Sailor and Lieutenant because of the Lieutenant group weight.

So I experimented by creating a set of 7 LuckPerms groups each with a higher weight than Lieutenant with the theory that the Lieutenant would inherit the ranks, deny them, and then the inherited groups in the inherited groups would have a higher weight and override for the other group that they inherit (For example sailor).

So I tried this setup too: PirateCraft Ranks(1)

But this does not work either, the denying the permissions at lieutenant override the cmi_group's weight I think because of how permission calculation works https://luckperms.net/wiki/Advanced-Setup

Can you think of a way to solve this permissions issue to allow Donators/Staff to use the ranking system and setting thier default starting role to one of the ranks they also are parent to? Or would it be better to implement another permission/setting to somehow fix this.

Steev93 commented 2 years ago

Have you tried doing this through Luck perms?

%luckperms_primary_group_name% | Returns the name of the player's primary group.

%luckperms_highest_group_by_weight% | Returns the name of the players highest weighted group, not including groups they indirectly inherit from others.

%luckperms_lowest_group_by_weight% | Returns the name of the players lowest weighted group, not including groups they indirectly inherit from others.

See; https://luckperms.net/wiki/Placeholders