
Changes to world rewrites & shorthand server/world args
Closed this issue · 5 comments
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.
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
I'm open to suggestions, but currently re-implementing it isn't an option.
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.
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)
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?)
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.