[PR #4680] [MERGED] Add /op, /deop, /ban, /pardon and /whitelist to a dedicated server's commands #5775

Closed
opened 2026-11-03 05:14:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4680
Author: @levzzz5154
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @levzzz5154

Base: main ← Head: parity/34-profiles


📝 Commits (1)

  • e1a530a Add /op, /deop, /ban, /pardon and /whitelist as commands of a dedicated server

📊 Changes

7 files changed (+402 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+4 -0)
📝 crates/horizon-client/src/game/commands.rs (+17 -0)
➕ crates/horizon-client/src/game/commands/profiles.rs (+277 -0)
📝 crates/horizon-client/src/game/dedicated.rs (+30 -12)
📝 crates/horizon-command/src/tests.rs (+36 -0)
📝 crates/horizon-command/src/tree_extra.rs (+33 -0)
📝 crates/horizon-command/src/vanilla_order.rs (+5 -0)

📄 Description

🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally.

Part of #3520

Operators of a dedicated server can now run /op, /deop, /ban, /pardon and /whitelist in game; until now only the server console had them (and the client tree listed them, but the server answered "unknown command").

Rows

  • GameProfileArgument.SelectorResult.getNames: a selector target gives the players it finds (argument.entity.notfound.player when none, argument.player.entities for entity selectors at parse); a name goes through the user cache (argument.player.unknown). game/commands/profiles.rs::game_profiles.
  • OpCommand.opPlayers, DeOpCommands.deopPlayers (kicks unlisted players), BanPlayerCommands.banPlayers (source name is getTextName, reason is the message's string, online players are disconnected with multiplayer.disconnect.banned), PardonCommand.pardonPlayers, WhitelistCommand (on, off, list, add, remove, reload): same messages, lang keys, errors and broadcast/non-broadcast sendSuccess as vanilla; they act on the lists the console handlers use (horizon-server-files) and on white-list in server.properties.
  • horizon-command: the five commands in the tree at level 3 (admins), children in vanilla's order. On a server that is not dedicated they answer command.unknown.command, like publish does the other way round.

The console's own handlers in game/dedicated.rs are unchanged (shared helpers made pub(super)).

Vanilla methods followed

OpCommand, DeOpCommands, BanPlayerCommands, PardonCommand, WhitelistCommand (register and each executor), GameProfileArgument.parse / SelectorResult.getNames, CommandSourceStack.sendSuccess / getTextName.

Tests

horizon-command tests::profile_commands_parse_like_vanilla; fmt, clippy -p horizon-command -p horizon-client --all-targets -D warnings, cargo test -p horizon-command, horizon-client --lib/--bins command pass. Not run here: parity harnesses (CI).

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/4680 **Author:** [@levzzz5154](https://github.com/levzzz5154) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `parity/34-profiles` --- ### 📝 Commits (1) - [`e1a530a`](https://github.com/horizon-rust/horizon/commit/e1a530a71e440100f907f2234bee06c96b5484cb) Add /op, /deop, /ban, /pardon and /whitelist as commands of a dedicated server ### 📊 Changes **7 files changed** (+402 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+4 -0) 📝 `crates/horizon-client/src/game/commands.rs` (+17 -0) ➕ `crates/horizon-client/src/game/commands/profiles.rs` (+277 -0) 📝 `crates/horizon-client/src/game/dedicated.rs` (+30 -12) 📝 `crates/horizon-command/src/tests.rs` (+36 -0) 📝 `crates/horizon-command/src/tree_extra.rs` (+33 -0) 📝 `crates/horizon-command/src/vanilla_order.rs` (+5 -0) </details> ### 📄 Description > 🤖 Opened by levzzz5154's AI agent (Claude Code, Claude Sonnet 5.5), not by levzzz5154 personally. Part of #3520 Operators of a dedicated server can now run `/op`, `/deop`, `/ban`, `/pardon` and `/whitelist` in game; until now only the server console had them (and the client tree listed them, but the server answered "unknown command"). ## Rows - `GameProfileArgument.SelectorResult.getNames`: a selector target gives the players it finds (`argument.entity.notfound.player` when none, `argument.player.entities` for entity selectors at parse); a name goes through the user cache (`argument.player.unknown`). `game/commands/profiles.rs::game_profiles`. - `OpCommand.opPlayers`, `DeOpCommands.deopPlayers` (kicks unlisted players), `BanPlayerCommands.banPlayers` (source name is `getTextName`, reason is the message's string, online players are disconnected with `multiplayer.disconnect.banned`), `PardonCommand.pardonPlayers`, `WhitelistCommand` (`on`, `off`, `list`, `add`, `remove`, `reload`): same messages, lang keys, errors and broadcast/non-broadcast `sendSuccess` as vanilla; they act on the lists the console handlers use (`horizon-server-files`) and on `white-list` in server.properties. - `horizon-command`: the five commands in the tree at level 3 (admins), children in vanilla's order. On a server that is not dedicated they answer `command.unknown.command`, like `publish` does the other way round. The console's own handlers in `game/dedicated.rs` are unchanged (shared helpers made `pub(super)`). ## Vanilla methods followed `OpCommand`, `DeOpCommands`, `BanPlayerCommands`, `PardonCommand`, `WhitelistCommand` (register and each executor), `GameProfileArgument.parse` / `SelectorResult.getNames`, `CommandSourceStack.sendSuccess` / `getTextName`. ## Tests `horizon-command tests::profile_commands_parse_like_vanilla`; fmt, `clippy -p horizon-command -p horizon-client --all-targets -D warnings`, `cargo test -p horizon-command`, `horizon-client --lib/--bins command` pass. Not run here: parity harnesses (CI). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:14:55 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5775
No description provided.