TownyAdvanced / Towny

Towny Advanced Minecraft plugin for Bukkit/Spigot.
https://townyadvanced.github.io
Other
519 stars 356 forks source link

Towny not giving permissions when a rank is set #2967

Closed TKwSni closed 6 years ago

TKwSni commented 6 years ago

All my players complain about their assistants cant do anything in their towns, leave join plot, relog, leave and rejoin the rank, anything wont work to activate the permissions in that rank.

For me it works only when I leave and rejoin the plot, but still is something that didnt happen in earlier versions of towny, as soon as you get the rank you were able to do anything as assistant, now it's unpredictable.

What steps will reproduce the problem?

  1. add/remove anyone assistant rank with break switch permissions
  2. Try to break or do anything as assistant

What is the expected output?

  1. Get/Deny instantly permissions to all rank permission nodes

What is your Towny version?

Towny version 0.92.0.10

What is your spigot/craftbukkit version?

This server is running CraftBukkit version git-Spigot-2086bb0-2f3ed3b (MC: 1.12.2) (Implementing API version 1.12.2-R0.1-SNAPSHOT)

  1. Your full server startup from the logs\latest.log : https://pastebin.com/UgRXnSJx
  2. Your Towny config.yml (if using MySQL please remove password,) : https://pastebin.com/FKKUYY1S
  3. Your townyperms.yml: https://pastebin.com/TcfcSb4x
  4. Your log's error : no error
Phyther commented 6 years ago

I have had this occasionally happening with players being promoted/demoted as well in 0.92.0.12. It doesn't happen every time, and a relog fixes the issue. But if a mayor is trying to remove someone from power because they are abusing rank, then this could be a problem.

TKwSni commented 6 years ago

Today other players were complaining that they couldnt use /town deposit until I gave the permission node using my permissions plugin, there is something wrong with the permissions handler of towny. As soon as i gave them the deposit node using my main permissions plugin, they were able to deposit.

LlmDl commented 6 years ago

@Blackyvk this is likely on the side of your permission plugin, especially if you're using luckperms, it is tricky to configure it properly.

TKwSni commented 6 years ago

But when I did this test, I removed almost all the plugins, if you check the log, I believe only vault essentials and towny were loaded, just to make sure it wasnt an incompatibility with luckperms... I do have luckperms on my live server but i didnt use it when testing the issue on my pc.

LlmDl commented 6 years ago

I'll check it out when I have time, do you have a set of commands steps I can use to repeat what you have happening?

TKwSni commented 6 years ago

Basically,

If you do this the other way around, from assistant from resident, same results but instead he can do everything and break until he leaves and join the plot

If you wantme to test with you or to show you, let me know i'll message you on discord

LlmDl commented 6 years ago

What you just described is how the cache works, it's probably just not resetting the player's cache when a rank is applied/removed.

TKwSni commented 6 years ago

but we didnt have this problem before, even players after they had the rank for days they lose they permissions until i reload the plugin or they relog several times.... i'll try older towny versions see If the issue persists because I have used towny before for years and It didnt behave like this

LlmDl commented 6 years ago

That part sounds like a permission plugin problem. A relog would only be required one time if it was an issue with Towny, the player's permission cache is updated on login.

TKwSni commented 6 years ago

Any idea what should I do with luckeprms for that matter? I have the default config.yml

only changes are: split storage: enabled: true use-server-uuid-cache: true

Phyther commented 6 years ago

Try doing /lp sync

Apparently luckperms caches permissions, indefinitely...

Apparently there is a way to write a plugin that does a sync every time a command is run with the LuckpermsAPI, but that is beyond my ability

On Sat, Jul 7, 2018, 5:54 PM Blackyvk notifications@github.com wrote:

Any idea what should I do with luckeprms for that matter? I have the default config.yml https://raw.githubusercontent.com/lucko/LuckPerms/master/bukkit/src/main/resources/config.yml

only changes are: split storage: enabled: true use-server-uuid-cache: true

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/TownyAdvanced/Towny/issues/2967#issuecomment-403250576, or mute the thread https://github.com/notifications/unsubscribe-auth/AiPfu1k9iUd5OMzfNRkDoATHQ-XUUcKMks5uEUo-gaJpZM4VBuO5 .

LlmDl commented 6 years ago

I've made the change to reset a player's cache when their rank is changed in 0.92.0.13, which you can get from teh Discord's #new_builds channel.

Phyther commented 6 years ago

I'll check it out tomorrow night. Does this include the LP integration?

LlmDl commented 6 years ago

It doesn't as we don't have a dedicated permission handler for LP yet and I don't really want to add a janky test to handle it just yet.

Phyther commented 6 years ago

Ok, I'll test this and see if it helps and let you know.

On Sun, Jul 8, 2018, 11:32 PM LlmDl notifications@github.com wrote:

It doesn't as we don't have a dedicated permission handler for LP yet and I don't really want to add a janky test to handle it just yet.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/TownyAdvanced/Towny/issues/2967#issuecomment-403364333, or mute the thread https://github.com/notifications/unsubscribe-auth/AiPfu9CmVUSD138PhXY0aR4Tpsm-Y2gPks5uEurXgaJpZM4VBuO5 .

Phyther commented 6 years ago

Ok, I tested with 0.92.0.13 and the rank still does not remove the permissions when removed or add the permissions when the rank is added.

LlmDl commented 6 years ago

I just did the following:

The only thing I didn't do was use LuckPerms. Can one of you please retest using the steps above please.

@Blackyvk you wrote: "Resident tries to break or open doors chests (he cant do it, on some parts of the plot on others he can, no towny error message anywhere)" when no message is shown at all then it's not towny blocking the actions, could there be another plugin protecting things there?

Phyther commented 6 years ago

So, I followed the instructions (changing a lever to a door). I have towny 0.92.0.13 installed, luckperms 4.2.2, and not a whole lot else on this server. The player couldn't switch, promoted them and they instantly could switch without leaving the plot, demoted them, and instantly they couldn't switch. Now I'm confused.

TKwSni commented 6 years ago

@LlmDl It works for me with luckperms, in my test server I'll have to test it live to be sure...

any way I could just apply the fix to that version only? to avoid having to go trough all the updates or new additions that are still in development

LlmDl commented 6 years ago

@Blackyvk if you have your own fork of Towny you could PR yourself just the one commit that fixed the issue on our end. The jump from 0.92.0.10 to 0.92.0.13 isn't that big and soon enough you'll have access to 0.93.0.0 which will have the same amount of work to upgrade (not much work really.)