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

Fix duplicate extension's help command permission registration on Paper #4079

Merged
merged 3 commits into from
Aug 27, 2023

Conversation

onebeastchris
Copy link
Member

Fixes #4078 by checking if a permission already exists before attempting to add it.

Caused by Geyser registering multiple /<extensionid> help commands under the same permission.
This fix would just avoid re-registering these permissions.
To help debugging issues, the duplicated permissions are logged in debug mode.

Additionally, i removed the check for floodgate-bukkit, which was added two years ago.

@Konicai
Copy link
Member

Konicai commented Aug 24, 2023

Shouldn't the extensions's ID be a part of its help command permission? I don't understand why the permission was chosen to be the same or every extension help instance.

@onebeastchris
Copy link
Member Author

It could be, but what's the point restricting some extensions help command? Either you want to see all command listings for all extensions, or for none :p
Personally, i would leave the permission as is, and just avoid re-registering it

@Konicai
Copy link
Member

Konicai commented Aug 24, 2023

Same reason as not having every single /spigotPlugin help command be under the same permission

extensions that aren't targeted towards the base player don't need to be exposed in that regard

@onebeastchris
Copy link
Member Author

OK, valid. I'll change the permissions to include the extension id - i personally would leave in the duplicate permission check though in case two extensions try to register a command with the same permission.

@onebeastchris
Copy link
Member Author

image
with the latest changes, all extension's help/? commands have separate permissions.

@onebeastchris onebeastchris changed the title Fix duplicate permission registration on Paper Fix duplicate extension's help command permission registration on Paper Aug 24, 2023
@onebeastchris
Copy link
Member Author

onebeastchris commented Aug 24, 2023

Also noticed the wrong header for extension help commands; fixed that too
image
image
Now it shows "Geyser extensions" instead of "Showing Help For: Geyser" when running an extensions help command.

Ideally, it would show "Showing help for %extensionname%", not sure if that can be easily done

@rtm516 rtm516 added the PR: Bugfix When a PR contains a bugfix label Aug 24, 2023
@rtm516 rtm516 merged commit 00def3b into GeyserMC:master Aug 27, 2023
1 check passed
@onebeastchris onebeastchris deleted the avoid-duplicate-permissions branch August 27, 2023 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Extensions PR: Bugfix When a PR contains a bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

paper doesn't allow multiple commands to share the same permission
4 participants