AcmeProject / WildernessTp

My WildernessTP plugin from spigot
GNU General Public License v3.0
13 stars 16 forks source link

Per world permissions doesn't work. #76

Closed sketrick closed 4 years ago

sketrick commented 4 years ago

Could per world permissions be added? Because now there's only option to allow players to RTP to all worlds or just in the world they're in. It would really help a lot and it's a feature all RTP plugins should have.

RoboMWM commented 4 years ago

Uh, yea, you use your permissions plugin to perform per-world permissions.

sketrick commented 4 years ago

Sorry, maybe I wasn't clear on what I meant. I want people to be able to teleport from "spawn" world. To three other worlds: (resources, spawn_nether and spawn_the_end) all from the same world. Or any of the three worlds listed. But I also have worlds that I don't want people teleporting to like "dungeon" . What you said will only allow people to do /wild in the world that they are currently in, but I want them to be able to do "/wild spawn_the_end" from any of the world but at the same time I don't want them do be able to do "/wild dungeon" as it's only available for admins.

RoboMWM commented 4 years ago

Yea ok that is indeed different.

I think then this is a duplicate of another issue that I can't recall right now, can you find and confirm/deny?

sketrick commented 4 years ago

Don't know, but to be clear on what I'm asking for is simply this: wild.wildtp.world - This permission gives players access to do /wild [all available worlds]

I would like so this permission would have sub permissions for example: wild.wildtp.world.* - would give the permission to do /wild [all available worlds] wild.wildtp.world.spawn_the_end - Would give permission to do /wild spawn_the_end from any world. wild.wildtp.world.dungeon - Also so I could cancel this permission out with LuckPerms feature so people can't do /wild dungeons if they have access to all worlds.

RoboMWM commented 4 years ago

So I checked and this feature actually already exists.

sketrick commented 4 years ago

Then what am I doing wrong as it doesn't work.

sketrick commented 4 years ago

wild.wildtp.world this permission gives access to all worlds, but I can't specify worlds I want players to be able to access.

RoboMWM commented 4 years ago

What permissions plugin are you using, I wonder if it's granting access to all subchildren. I looked at the logic and it only executes if you grant wild.wildtp.world AND either of the two: wild.wildtp.world.* or wild.wildtp.world.(world name here)

RoboMWM commented 4 years ago

https://github.com/AcmeProject/WildernessTp/blob/ab58f3c52051776bbb50f8d0127ec55a73ab278d/src/main/java/net/poweredbyhate/wildtp/CommandsGoneWild.java#L93-L94

RoboMWM commented 4 years ago

Output of /version Wild ?

sketrick commented 4 years ago

Hi, sorry for late response I was busy and couldn't check. Version is 2.18-ab58f3c just updated. And permission still doesn't work. My worlds are controlled by worldguard and multiversecore. And permissions with luckperms. wild.wildtp.world.resources I give this permission to default group and players still can't do /wild resources says don't have permission.

RoboMWM commented 4 years ago

Hmm, I think luckperms has a way to check if a player has a given permission. Can you try checking if they have wild.wildtp.world.* and etc. and see what the responses are? I'll probably add some debugging too.

sketrick commented 4 years ago

Here it finds that default group has the permission but it does nothing. https://ibb.co/jRLVzj6

sketrick commented 4 years ago

https://ibb.co/c62wJfL

sketrick commented 4 years ago

wild.wildtp.world.* This doesn't even give permission to all worlds in the first place. wild.wildtp.world - but this does. https://ibb.co/XtgLj4w

RoboMWM commented 4 years ago

none of the image URLs appear to be working? Try imgur instead? (Or you can upload here directly too.)

RoboMWM commented 4 years ago

you need to provide both if you're using the wildcard.

sketrick commented 4 years ago

https://ibb.co/BzM8Bgr https://ibb.co/QDRcMDP https://ibb.co/DtsVfW9

sketrick commented 4 years ago

Here I gave default group wild.wildtp.world permission and gave worlds I don't want them to teleport to false permissions. They are still allowed to go to all these worlds. https://ibb.co/tbprFM8

RoboMWM commented 4 years ago

and you ensured that they don't have wild.wildtp.world.*?

Btw, you can embed images in here directly like so: ![](image-url-here)

sketrick commented 4 years ago

Yes, and as I said before wild.wildtp.world gives access to all worlds. wild.wildtp.world.* - This does nothing and wild.wildtp.world.resources setting this permission to false still allows players to use /wild resources

sketrick commented 4 years ago

There are all the permission I gave the default group.

RoboMWM commented 4 years ago

wild.wildtp.world.* will do nothing on its own, but it will grant access to every world if it is set along with wild.wildtp.world.

Anyways, please test this debug version, ensure debug mode is enabled and provide logs of the scenarios please. https://ci.appveyor.com/project/RoboMWM39862/wildernesstp/builds/33373387/artifacts

sketrick commented 4 years ago

wild.wildtp.world this already grant access to every world. I'll try the plugin you provided when I can.

sketrick commented 4 years ago

wild.wildtp.world - This permission shouldn't exist at all it's conflicting with wild.wildtp.world.* and makes all the wild.wildtp.world.worldname obsolete.

sketrick commented 4 years ago

So what do you want me to do with the plugin you linked? I installed it tried out it out and nothing. There's no difference wild.wildtp.world This on it's own grants access to all worlds wild.wildtp.world.* this doesn't do anything as per previous permission you already have access to all worlds. What more can I do and what else do you need to know?

RoboMWM commented 4 years ago

wild.wildtp.world - This permission shouldn't exist at all it's conflicting with wild.wildtp.world.* and makes all the wild.wildtp.world.worldname obsolete.

Not sure how this makes any sense. Permissions in Bukkit are merely strings that don't even have a concept of a * or any other "hierarchy" based on permission name. If this is really LuckPerms doing this, I think you may have to disable something that attempts to match all of these "child" permissions.

So what do you want me to do with the plugin you linked?

Test your scenarios (having the different permissions set) and report results along with the debug messages for each.

sketrick commented 4 years ago

I got a work around going. it might be useful to other people. So to get working permissions that I want you have to have this permissionwild.wildtp.world and set this permission to false wild.wildtp.world.* now set permission true for worlds you want people to teleport to with this wild.wildtp.world.worldname now player still will see all the worlds auto filling with /wild but only be able to teleport to the worlds that they have permission to.

RoboMWM commented 4 years ago

Huh, interesting. I still would've liked to see the debug output but I guess that works too.