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: version command issues #6357

Open
wants to merge 7 commits into
base: stable
Choose a base branch
from

Conversation

nicholass003
Copy link
Contributor

Introduction

This pull request is to handle users using the version command for detailed things, such as checking plugin information.

Relevant issues

Fixes #6322

Changes

API changes

Added DefaultPermissionNames::COMMAND_VERSION_DETAIL -> Allows the user to view the detailed version of the server.

Behavioural changes

Backwards compatibility

Follow-up

Tests

I tested this PR by doing the following (tick all that apply):

  • Writing PHPUnit tests (commit these in the tests/phpunit folder)
  • Playtesting using a Minecraft client (provide screenshots or a video)
  • Writing a test plugin (provide the code and sample output)
  • Other (provide details)

@jasonw4331 jasonw4331 added Category: Core Related to internal functionality Type: Fix Bug fix, typo fix, or any other fix labels Jun 23, 2024
ShockedPlot7560
ShockedPlot7560 previously approved these changes Jul 5, 2024
Copy link
Member

@ShockedPlot7560 ShockedPlot7560 left a comment

Choose a reason for hiding this comment

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

Need translation follow up

@nicholass003
Copy link
Contributor Author

Need translation follow up

just added english for now, pmmp/Language#182

Copy link
Member

@dktapps dktapps left a comment

Choose a reason for hiding this comment

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

I think "detailed version" and the general "detail" wording is too vague. Be more specific - this is for restricting access to plugin versions.

@nicholass003
Copy link
Contributor Author

I think "detailed version" and the general "detail" wording is too vague. Be more specific - this is for restricting access to plugin versions.

Is there some suitable name for this?
i have several names :

  • pocketmine.permission.command.version.plugins - Allows the user to view information about all server plugins.
  • pocketmine.permission.command.version.info - Allows the user to view detailed information about all plugins used by the server.
  • pocketmine.permission.command.version.pluginInfo - Allows the user to access information for all plugins on the server.

@dktapps
Copy link
Member

dktapps commented Aug 28, 2024

First one seems the most obvious to me. Don't overthink it.

@dktapps
Copy link
Member

dktapps commented Aug 28, 2024

that being said, those names look AI generated ...

@nicholass003
Copy link
Contributor Author

that being said, those names look AI generated ...

for the desc yes 😁

@@ -106,6 +106,7 @@ public static function registerCorePermissions() : void{
self::registerPermission(new Permission(Names::COMMAND_UNBAN_IP, l10n::pocketmine_permission_command_unban_ip()), [$operatorRoot]);
self::registerPermission(new Permission(Names::COMMAND_UNBAN_PLAYER, l10n::pocketmine_permission_command_unban_player()), [$operatorRoot]);
self::registerPermission(new Permission(Names::COMMAND_VERSION, l10n::pocketmine_permission_command_version()), [$everyoneRoot]);
self::registerPermission(new Permission(Names::COMMAND_VERSION_PLUGINS, l10n::pocketmine_permission_command_version_plugins()), [$operatorRoot]);
Copy link
Member

Choose a reason for hiding this comment

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

This will cause problems for people who set pocketmine.command.version expecting it to set this permission as well.

It's probably better to have:

  • pocketmine.command.version.server
  • pocketmine.command.version.plugins

and then have pocketmine.command.version as a deprecated backwards-compatible group permission for the remainder of PM5. See how this was done for /effect in PM4:

$effectRoot = self::registerDeprecatedPermission(Names::COMMAND_EFFECT);
self::registerPermission(new Permission(Names::COMMAND_EFFECT_OTHER, "Allows the user to modify effects of other players"), [$operatorRoot, $effectRoot]);
self::registerPermission(new Permission(Names::COMMAND_EFFECT_SELF, "Allows the user to modify their own effects"), [$operatorRoot, $effectRoot]);

This will permit people to still explicitly set pocketmine.command.version to get the same functionality as it would previously, but since it won't be given to any groups, default functionality will be controlled by these new permissions.

(Side note for maintainers: If #6324 were implemented, explicitly registering deprecated group roots wouldn't be necessary anymore.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core Related to internal functionality Status: Waiting on Author Type: Fix Bug fix, typo fix, or any other fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"/ver", "/version" and "/about" commands issue.
4 participants