Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error thrown for all logged in players when changing gold #74

Open
RaaviArda opened this issue Feb 19, 2023 · 2 comments
Open

Error thrown for all logged in players when changing gold #74

RaaviArda opened this issue Feb 19, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@RaaviArda
Copy link

I have the following setup:
Party Resources set to track gold across all players
Whenever any player changes their gold (or I change it) all players get a red error notification saying:
Uncaught (in promise) Error: User lacks permission to update Setting [ai2WtiaeaY04G3g7]

Setting with ID ai2WtiaeaY04G3g7 is:
key: "fvtt-party-resources.gp"
value: 244.9 (current party gold)

Disabling tracking of the resource removes the error.
Same issue is for objects tracked by the module, ie. I'm tracking all rations across all characters and if any character has his/her rations changed all players get relevant error just with ID of a different setting.

Players are NOT suposed to change the values and the setting "Allow players to manage this resource" is NOT checked for any of those.

@davelens
Copy link
Owner

davelens commented Feb 20, 2023

@RaaviArda Am I right in assuming the gold and/or item count still works, even though it throws this error? If so, I was able to reproduce this:

The module listens for changes to gold, or items in your inventory, to add up all numbers across all players. When it does that, it works the same way a regular resource works when it receives an update. That means it will attempt to write something to Foundry's centralized setting database (i.e. game.settings), but it does not actually write a value that's visualized in the module. This means you see the error message that the player lacks permission to do so (which is correct), but it doesn't matter when it accounts for gold or items because it just sums player data instead of showing a stored value from game.settings.

In a way I've abused my own module to add this functionality, but the permission error itself is not intended. 😄 I'll see about getting rid of the error so no one sees this. Pending an update on the module itself though, there's an easy way to get rid of the errors for your players right now, by pressing the button marked with red as shown in the screenshot below. Pressing that button will not allow players to adjust resources (hence the separate checkbox), but it will allow their client to do writes in the background, so they won't receive the error anymore.

modify-config-settings

Thank you for reporting this!

@davelens davelens added the bug Something isn't working label Feb 20, 2023
@RaaviArda
Copy link
Author

Thanks for verifying and yes - everything works as intended except for the error thrown. It's just annoying, especially when I give out ie. quest rewards and everyone starts updating their gold.
I don't want to give players ability to modify configuration because I have a ton of modules they could abuse with such power :-D So I'll have to live with the error spam until you fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants