LuckPerms

LuckPerms

41.4k Downloads

Pex migration issues with default group and chat prefixes

LemADEC opened this issue ยท 18 comments

commented

As of LuckPermsSponge-2.15.5.jar, after migrating from Pex, we're having several issues.

In Pex, a user with no group is defaulting to the "member" group. Also, prefix are prioritized using the "weight" option. Here's an extract from our Pex configuration file:

{
    "subjects": {
        "default": {
            "default": [
                {
                    "contexts": {
                        "localip": "127.0.0.1"
                    },
                    "permissions-default": 0
                },
...
            "user": [
                {
                    "parents": [
                        "group:member"
                    ],
                    "permissions-default": 0
                }
            ]
        },
        "group": {
            "default": [
                {
                    "options": {
                        "prefix": "&7Guest "
                    },
                    "permissions-default": -1
                }
            ],
            "member": [
                {
                    "options": {
                        "weight": "99999",
                        "rank-ladder": "staff",
                        "rank": "1000",
                        "prefix": "&7Member "
                    },
                    "permissions-default": 0,
...
                }
            ],
            "moderator": [
                {
                    "parents": [
                        "group:minimod"
                    ],
                    "options": {
                        "weight": "10400",
                        "rank-ladder": "staff",
                        "rank": "400",
                        "prefix": "&bMod "
                    }
                }
            ],
            "minimod": [
                {
                    "options": {
                        "weight": "10450",
                        "rank-ladder": "staff",
                        "rank": "450",
                        "prefix": "&bMiniMod "
                    },
                    "parents": [
                        "group:member"
                    ]
                }
            ],
...

After migrating to LP, I've noted the following issues:
1- users with no group defined, are attached to the "default" group.
To fix this, I've added "member" group has a parent of "default" group
and I've cleared the "default" group prefix.

2- staff users (a moderator) remain with the "Member " prefix.
From what I understand, all chat prefixes from all groups have the same priority of 100 in LP.
Looks like Pex weight needs to be converted into "chat priority" during migration.

3- I can't remove the migrated prefixes with commands:

>lp group moderator meta info
[19:59:47] [Server thread/INFO] [nucleus]: Server ran the command: /lp group moderator meta info
[19:59:47] [pool-3-thread-38/INFO]: [LP] moderator's Prefixes
[19:59:47] [pool-3-thread-38/INFO]: [LP] -> 100 - "Member " (inherited from member)
[19:59:47] [pool-3-thread-38/INFO]: [LP] -> 100 - "MiniMod " (inherited from minimod)
[19:59:47] [pool-3-thread-38/INFO]: [LP] -> 100 - "Mod " (inherited from self)
[19:59:47] [pool-3-thread-38/INFO]: [LP] moderator has no suffixes.
[19:59:47] [pool-3-thread-38/INFO]: [LP] moderator's Meta
[19:59:47] [pool-3-thread-38/INFO]: [LP] -> rank = "450" (inherited from minimod)
[19:59:47] [pool-3-thread-38/INFO]: [LP] -> rank-ladder = "staff" (inherited from self)
[19:59:47] [pool-3-thread-38/INFO]: [LP] -> weight = "10450" (inherited from minimod)
[19:59:47] [pool-3-thread-38/INFO]: [LP] -> weight = "99999" (inherited from member)
[19:59:47] [pool-3-thread-38/INFO]: [LP] -> rank = "1000" (inherited from member)
[19:59:47] [pool-3-thread-38/INFO]: [LP] -> weight = "10400" (inherited from self)
[19:59:47] [pool-3-thread-38/INFO]: [LP] -> rank = "400" (inherited from self)
>lp group moderator meta removeprefix 100 "Mod "
[19:59:59] [Server thread/INFO] [nucleus]: Server ran the command: /lp group moderator meta removeprefix 100 "Mod "
[19:59:59] [pool-3-thread-42/INFO]: [LP] moderator doesn't have that prefix set.
>lp group moderator meta addprefix 10450 "Mod "
[20:00:07] [Server thread/INFO] [nucleus]: Server ran the command: /lp group moderator meta addprefix 10450 "Mod "
[20:00:07] [pool-3-thread-40/INFO]: [LP] moderator had prefix "Mod " set at a priority of 10450.
[20:00:07] [pool-3-thread-40/INFO]: [LP] (Group data was saved to storage)
>lp group moderator meta removeprefix 10450 "Mod "
[20:00:14] [Server thread/INFO] [nucleus]: Server ran the command: /lp group moderator meta removeprefix 10450 "Mod "
[20:00:14] [pool-3-thread-40/INFO]: [LP] moderator had prefix "Mod " at priority 10450 removed.
[20:00:14] [pool-3-thread-40/INFO]: [LP] (Group data was saved to storage)
commented

For issue 1, a warning or something would help.

For issue 2, the weight is visible in LP, so I assumed LP could transfer it back to chat priority, or did I miss something?

For issue 3, the color code isn't escaped neither the color is rendered in console. Could we have either of those?.

commented

Color rendering in Console just doesn't work for SpongeForge - it works for all other platforms.

As for the migration thing, I can't really add warnings for it. I simply cannot automate absolutely everything. The idea with migration is to be an aid, not just a tool to blindly move to LP. I expect users to read the wiki as well as using the migration commands. :)

Will work on the weight stuff soon.

commented

Your fix to No. 1 is the best approach. It's documented in the wiki under the "default groups" section.

I'll look into trying to migrate weights. It's actually somewhat difficult to do though - that data doesn't get exposed directly to Sponge.

The issue with No. 3 is probably because of color codes? Not too sure. You could also use /lp group moderator meta removeprefix 100 null to remove all prefixes set at 100 priority.

commented

You were going to get back to me about whether it's weight or rank. Any ideas?

commented

I've tested SpongePex for prefix priority but couldn't make much sense of it so far.

commented

One suggestion through, herited groups with the same priority shouldn't take priority on the child groups.
For example, minimod is the parent of the mod group, both having prefix with priority 100. Then mod prefix should prevail.

commented

I mean it would be simpler if it worked by default as "my current group prefix takes priority over my parent prefix".
The same way it does with "player prefix takes priority over any group prefix".

commented

Then the mod prefix needs to have a higher priority

commented

That would go against the whole meta priority system :/

commented

I'm talking only when priorities are the same. Obviously, if priorities are different, they should take precedence.

commented

Sorry - again late reply...

Why did you mean by this: "my current group prefix takes priority over my parent prefix"

Not sure what you mean by "current" group - do you mean primary group? or something else.

commented

I mean that inherited metas should have less priority.
My supermod group has a parent group named moderator, which has a parent group named minimod.
When I set a prefix for each group with same priority, I expect the child group to overwrite its parent meta.

commented

That should happen already? Are you sure it doesn't work?

commented

Pretty sure it doesn't work in 2.15.5

commented

Still an issue as of LuckPerms-Sponge-2.16.24.jar
image

[14:14:43] [Server thread/INFO]: Admin LemADEC: t
[14:14:51] [Server thread/INFO] [nucleus]: LemADEC ran the command: /lp group member     meta addprefix 800 "&7Member "
[14:14:52] [pool-3-thread-31/INFO]: [LP] LOG > (LemADEC) [G] (member) --> meta addprefix 800 "Member "
[14:14:53] [Server thread/INFO]: Member LemADEC: t
[14:15:02] [Server thread/INFO] [nucleus]: LemADEC ran the command: /lp group member     meta removeprefix 800 "&7Member "
[14:15:02] [pool-3-thread-30/INFO]: [LP] LOG > (LemADEC) [G] (member) --> meta removeprefix 800 "Member "
[14:15:03] [Server thread/INFO]: Admin LemADEC: t
commented

Are you a member of "admin" as well as "member"?

commented
[15:35:51] [Server thread/INFO] [nucleus]: Server ran the command: /lp user LemADEC info
[15:35:51] [pool-3-thread-41/INFO]: [LP] > User Info: lemadec
[LP] - UUID: 92aae7f5-ebd8-46c7-b0b9-09c62643d64d
[LP] - Status: Offline
[LP] - Primary Group: default
[LP] - Counts:
[LP] -    Permissions: 3
[LP] -    Temporary Permissions: 0
[LP] -    Prefixes: 0
[LP] -    Suffixes: 0
[LP] -    Meta: 1
[15:35:51] [pool-3-thread-41/INFO]: [LP] - Parent Groups:
[15:35:51] [pool-3-thread-41/INFO]: [LP] -    > default
[15:35:51] [pool-3-thread-41/INFO]: [LP] -    > admin
[15:35:51] [pool-3-thread-41/INFO]: [LP] - Cached Data:
[LP] -    Is Loaded: false
[LP] -    Current Contexts: None
[LP] -    Current Prefix: None
[LP] -    Current Suffix: None

[15:38:18] [Server thread/INFO] [nucleus]: Server ran the command: /lp group default parent info
[15:38:18] [pool-3-thread-42/INFO]: [LP] default's Parent Groups:
> member
>
[15:38:18] [pool-3-thread-42/INFO]: [LP] default's Temporary Parent Groups:
None

member is a parent of default which is always parent of all users. Hence, ones need to force default prefix priority to very low value for other inheritances to work?

commented

Correct.

The "default" tree is being applied before the "admin" one.

Download the latest CI build and run /lp group default permission set group.weight.-1 true. Should fix your problem.

Please feel free to re-open if you can make any sense of the PEX rank system regarding migration. Sorry, I really just don't have the time to experiment with it myself. :/