LuckPerms

LuckPerms

41.4k Downloads

Changes to world rewrites & shorthand server/world args

Phoenix616 opened this issue · 5 comments

commented

Currently it is not possible to use regex to target certain servers/worlds. This was previously possible by setting the world or server to R=regex as described here. Eg. /lp group default permission set sometestpermission server=R=server_.+ would result in the permission applying on all servers starting with server_. This happens to both old permissions/parents and newly added ones.

commented

Yeah, the feature was removed in order to support faster lookups. Parsing the regex was slow, and it was affecting performance.

Without it, it allows me to store internal data in Multimaps, which means filtering out data according to contexts is really fast. Previously, long streams had to be used.

It's basically this (what I have now):
https://github.com/lucko/LuckPerms/blob/master/common/src/main/java/me/lucko/luckperms/common/core/model/PermissionHolder.java#L319

vs before:
https://github.com/lucko/LuckPerms/blob/2e75bc3f3b6461c36e8a2e8b33ba44667a1cac21/common/src/main/java/me/lucko/luckperms/common/core/model/PermissionHolder.java#L277-L279

I'm open to suggestions, but currently re-implementing it isn't an option.

commented

Well first off I suggest updating the wiki pages if such a change is made or mark the feature as removed there.

With this removed we really need more dynamic world-aliasing now as this was the major usecase for the regex feature.

commented

Wiki pages are already updated.
As I said before, I'm open to suggestions.

World rewrites should fill this gap.
https://github.com/lucko/LuckPerms/blob/master/bukkit/src/main/resources/config.yml#L53

as well as using static contexts. (groups of servers)

commented

Well these aren't really as dynamic as the regex/shorthands where. Maybe you could try to validate these on command input and try to match all known worlds/servers and add a permission/parent entry for each of them?

Also one downside of the current world-rewrite system seems to be that as soon as you add the rewrite you can't target that single world by its real name anymore? An alias system should be able to match all: The real name and all defined aliases. This would allow you to define multiple different world/server groups either via the world/server context settings directly or via an extra one like group or something.

And having commands ingame to define these aliases/groups would also be good instead of having to change the config file and having to reload the whole plugin. (Maybe that setting could be stored in another config file or added directly to the static-context.json?)

commented

Well these aren't really as dynamic as the regex/shorthands where. Maybe you could try to validate these on command input and try to match all known worlds/servers and add a permission/parent entry for each of them?

Yep, that's definitely an option.

Also one downside of the current world-rewrite system seems to be that as soon as you add the rewrite you can't target that single world by its real name anymore? An alias system should be able to match all: The real name and all defined aliases. This would allow you to define multiple different world/server groups either via the world/server context settings directly or via an extra one like group or something.

Agreed, that's possible now too.

And having commands ingame to define these aliases/groups would also be good instead of having to change the config file and having to reload the whole plugin. (Maybe that setting could be stored in another config file or added directly to the static-context.json?)

Yeah, I agree that would be useful too.