-
-
Notifications
You must be signed in to change notification settings - Fork 644
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
Cloud for commands #3808
base: master
Are you sure you want to change the base?
Cloud for commands #3808
Conversation
at least right now lol
bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/GeyserSpigotPlugin.java
Outdated
Show resolved
Hide resolved
...ocity/src/main/java/org/geysermc/geyser/platform/velocity/command/VelocityCommandSource.java
Show resolved
Hide resolved
any GeyserCommandSource should be valid to use in any CommandManager as long as one of the following is satisfied 1. it is a platform implementation 2. isConsole() returns true 2. playerUuid() returns a valid uuid and the player lookup succeeds
# Conflicts: # bootstrap/bungeecord/build.gradle.kts # bootstrap/spigot/build.gradle.kts # core/src/main/java/org/geysermc/geyser/command/GeyserCommandManager.java # core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/BedrockCommandRequestTranslator.java
# Conflicts: # bootstrap/standalone/src/main/java/org/geysermc/geyser/platform/standalone/gui/GeyserStandaloneGUI.java
# Conflicts: # bootstrap/fabric/src/main/java/org/geysermc/geyser/platform/fabric/GeyserFabricMod.java # bootstrap/fabric/src/main/java/org/geysermc/geyser/platform/fabric/command/FabricCommandSource.java # bootstrap/fabric/src/main/java/org/geysermc/geyser/platform/fabric/command/GeyserFabricCommandExecutor.java # bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/GeyserSpigotPlugin.java # core/src/main/java/org/geysermc/geyser/command/defaults/HelpCommand.java # core/src/main/java/org/geysermc/geyser/command/defaults/VersionCommand.java # core/src/main/resources/languages # gradle/libs.versions.toml
api/src/main/java/org/geysermc/geyser/api/permission/PermissionChecker.java
Show resolved
Hide resolved
core/src/main/java/org/geysermc/geyser/command/defaults/AdvancedTooltipsCommand.java
Outdated
Show resolved
Hide resolved
feeling kinda icky but idk
- create cloud earlier - trigger resource reload after geyser registers commands to cloud so that cloud registers them to the server
- updated GeyserPermission to 2.0 - removed mod platform specific permission checkers TODO: - test neoforge permission registration event - fix: exception handling
…ated # Conflicts: # bootstrap/bungeecord/build.gradle.kts # bootstrap/mod/fabric/build.gradle.kts # bootstrap/mod/neoforge/build.gradle.kts # bootstrap/spigot/build.gradle.kts # bootstrap/velocity/build.gradle.kts # gradle.properties
…ated # Conflicts: # gradle/libs.versions.toml # gradle/wrapper/gradle-wrapper.jar # gradlew
- Warn when a geyser dump arg isn't valid - don't register the `geyser` root literal with the geyser help permission
…ss manifest attribute directly - fix viaproxy plugin plugin warnings - update languages module
…mand event handler to deal with console commands
- update languages - remove permission from the spigot plugin.yml - catch RuntimeExceptions - properly send command.failed lang string
- dont register blank permissions - handle neoforge's picky hasPermission - register all Geyser non-command permissions as unset permissions
…ure/cloud # Conflicts: # bootstrap/mod/fabric/src/main/java/org/geysermc/geyser/platform/fabric/GeyserFabricBootstrap.java # bootstrap/mod/neoforge/src/main/java/org/geysermc/geyser/platform/neoforge/GeyserNeoForgeBootstrap.java # bootstrap/mod/src/main/java/org/geysermc/geyser/platform/mod/GeyserModBootstrap.java # bootstrap/spigot/src/main/java/org/geysermc/geyser/platform/spigot/world/manager/GeyserSpigotWorldManager.java # core/src/main/java/org/geysermc/geyser/command/defaults/StatisticsCommand.java # gradle.properties # gradle/libs.versions.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some thoughts that came to mind, looks good otherwise (skipped the NeoForge permission stuff, since well, that's known)
api/src/main/java/org/geysermc/geyser/api/event/lifecycle/GeyserRegisterPermissionsEvent.java
Outdated
Show resolved
Hide resolved
...forge/src/main/java/org/geysermc/geyser/platform/neoforge/GeyserNeoForgeCommandRegistry.java
Outdated
Show resolved
Hide resolved
...ndalone/src/main/java/org/geysermc/geyser/platform/standalone/GeyserStandaloneBootstrap.java
Outdated
Show resolved
Hide resolved
} | ||
|
||
if (command instanceof HelpCommand helpCommand) { | ||
permissionDefaults.put(helpCommand.rootCommand(), helpCommand.permissionDefault()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, typo on my side - this should call helpCommand.rootCommandPermission()
core/src/main/java/org/geysermc/geyser/command/CommandRegistry.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/geysermc/geyser/command/defaults/DumpCommand.java
Show resolved
Hide resolved
core/src/main/java/org/geysermc/geyser/extension/command/GeyserExtensionCommand.java
Outdated
Show resolved
Hide resolved
@Override | ||
public @NonNull UUID playerUuid() { | ||
return playerEntity.getUuid(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above, this could cause an NPE if it's called when we don't have a player entity yet (e.g. session login event)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could revert these changes in favour of your PR, but playerUuid()
is a new method.
I may as well implement it correctly (what you did)... and at that point I may as well implement the others correctly as well.
thoughts?
todo:
the lack of permissions on standalone. what this causes needs to be cleaned up, at least in extension commands.
create
permissions.yml
file for standaloneremove standalone permission hacks from builtin cmmands
isSuggestedOpOnly
is kind of problematic imo, in regards to its wording and the way it is used. it can probably just be deprecated in favour of optional permission registrationproperly handle stopping execution due to
isExecutableOnConsole
orisBedrockOnly
with descriptive messagesexceptions are completely unhandled on Geyser-Standalone right now
convert builtin commands to fully utilize cloud features
fix senderType
pretty sure just
/geyser
is suppose to send help?exception handlers needs to be overriden on every platform (except standalone i guess) so that messages can be properly localized
localize all messages
deal with possible trailing whitespace on geyser standalone gui
java players get suggested bedrock only commands -> additionally add platform check as a permission predicate
restore Spigot COMMAND_MAP lookup for descriptions
search CommandRegistry for our own description(s)
javadocs
check if we need to strip trailing whitespace before dispatching to cloud from BedrockCommandRequestTranslator (when Geyser Standalone is in use)
fix certain commands not working properly with
handleNoPermission
i think
command.failed
lang might be brokenensure all extension command permissions are registered on NeoForge, regardless of permission defaults. maybe just change the overall handling.
ensure viaproxy doesn't error on the clearing of the command manager when viaproxy was initialized, but not started
future and separate PRs
changes
GeyserCommandManager
has been renamed toCommandRegistry
GeyserCommandExecutor
and all subclasses have been removed in favour of Cloud.WorldManager#hasPermission
has been removed in favour of Cloud.Spigot
GeyserBrigadierSupport
has been removed in favour of Cloud.Standalone:
permissions.yml
has been added, a list of default permissions available to all players.Velocity/BungeeCord/Fabric/Standalone: commands are now registered before
GeyserPostInitializeEvent
, for consistency with Spigot, and to allow valid registration on Fabric.api changes:
deprecations
Command#isSuggestedOpOnly
and the relevant builder method have been deprecated for removalCommand#subCommands
has been deprecated for removal and will always returnCollections.emptyList()
Command#isExecutableOnConsole()
has been deprecated & replaced with#isPlayerOnly()
changes
Command#aliases()
now always returns an immutable listadditions
Command.Builder#permission(String, Tristate)
- register the permission and its default value to the server implementation if possible.CommandSource#playerUuid
- return a uuid if the source represents a player.CommandSource#connection
- return a Connection if the source represents a bedrock player managed by the current Geyser instance.GeyserRegisterPermissionCheckersEvent
- only used by Geyser-Standalone. Fired when the command manager is created. Allows registeringPermissionChecker
s to the manager. Event listeners with a higher listener priority will register PermissionCheckers as having a higher priority.PermissionChecker
- api interface that is responsible for resolving a CommandSource and a permission node to a Tristate.GeyserRegisterPermissionsEvent
- fired by a server platform, or extension, or anything, when it is the proper time for permissions to be registered to the event caller. This event will be called by Geyser-Spigot/Standalone/Forge. An extension may also fire the event in order to register permissions to LuckPerms for Geyser-Velocity/BungeeCord/Fabric. Geyser's CommandRegistry will listen for this event, but api users may as well.