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

Disallow formspec debug if the player does not have the debug privilege #14753

Merged
merged 6 commits into from
Jun 17, 2024

Conversation

l-koehler
Copy link
Contributor

@l-koehler l-koehler commented Jun 13, 2024

  • Goal of the PR
    Disallow players that do not have the "debug" privilege from viewing formspec debug info.
  • How does the PR work?
    It adds a check for the "debug" privilege before toggling the formspec debug view.
  • Does it resolve any reported issue?
    Fixes Everybody can see formspec debug #11689

To do

Ready for Review.

How to test

Open the inventory (or any other formspec), press F5 with and without the "debug" privilege.
The debug view should only be toggled with the "debug" privilege.

@Zughy Zughy added Feature ✨ PRs that add or enhance a feature Concept approved Approved by a core dev: PRs welcomed! labels Jun 13, 2024
src/gui/guiFormSpecMenu.cpp Outdated Show resolved Hide resolved
@l-koehler
Copy link
Contributor Author

Whenever the debug privilege gets removed, it now tries to disable the debug mode (can't do that when no formspec is open, but that doesn't matter as the debug mode does not persist across different formspecs).

Copy link
Contributor

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Code is simple and to the point. Tested, works:

  • Host server, join with another client.
  • Grant other client debug. Press F5 while in inventory formspec: works.
  • Revoke debug while other client has formspec debug enabled. The yellow debug overlays disappear immediately.
  • Try turning it on again: Doesn't work, as expected.
  • Re-grant privilege. Now it can be turned on again.

Copy link
Member

@grorp grorp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formspec debug no longer works in the mainmenu

@grorp grorp added the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Jun 16, 2024
@appgurueu appgurueu removed the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Jun 16, 2024
@sfan5 sfan5 merged commit fe6da3a into minetest:master Jun 17, 2024
13 checks passed
@l-koehler l-koehler deleted the debugformspec branch July 20, 2024 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Client / Audiovisuals Concept approved Approved by a core dev: PRs welcomed! Feature ✨ PRs that add or enhance a feature Formspec One approval ✅ ◻️
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Everybody can see formspec debug
6 participants