[PR #734] [MERGED] Dedicated server: guests' command feedback reaches the console and ops, @s is the guest #2767

Closed
opened 2026-11-02 15:58:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/734
Author: @ludovic111
Created: 10/17/2026
Status: ✅ Merged
Merged: 10/17/2026
Merged by: @ludovic111

Base: main ← Head: fix/guest-command-feedback


📝 Commits (4)

  • 91a4290 Guests' command feedback reaches the console and the other operators
  • e2f2177 Scoreboard: a guest's @s is the guest, not "Player"
  • 8912d5d dedicated_server harness: compare the op's command feedback on the console, and a score on @s
  • 59fe284 Commands name the guest who runs them, not "Player"

📊 Changes

9 files changed (+209 additions, -39 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+5 -0)
📝 crates/horizon-client/src/game/commands.rs (+51 -13)
➕ crates/horizon-client/src/game/commands/admin.rs (+92 -0)
📝 crates/horizon-client/src/game/commands/world_cmds.rs (+1 -2)
📝 crates/horizon-client/src/game/lan_actions.rs (+27 -0)
📝 crates/horizon-client/src/game/scoreboard.rs (+16 -18)
📝 crates/horizon-client/src/text.rs (+4 -0)
📝 mods/horizon/src/test/java/dev/horizonlab/parity/VanillaProtocolClient.java (+5 -0)
📝 tools/test_dedicated_server_parity.py (+8 -6)

📄 Description

🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself.

Two things server-host-3 found in how Horizon's dedicated server handles a guest's commands, plus a third found while testing them. Each now matches vanilla.

1. A guest's command feedback reaches the console and the other operators (CommandSourceStack.broadcastToAdmins)

  • When an operator runs /give @s coal, vanilla's console logs [Server thread/INFO]: System chat: [Tester: Gave 1 [Coal] to Tester]. Every other operator also gets the line, gray and italic.
  • Horizon logged nothing and told no one. It now does both, on the dedicated server:
    • the console line when log_admin_commands is on;
    • the line to every other operator when send_command_feedback is on.
  • The replies vanilla sends with broadcast false stay with the player who asked. These are queries and lists such as /seed, /time query, scoreboard players get, /data get and /locate. The 85 keys are listed in game/commands/admin.rs, taken from vanilla's sendSuccess(…, false) calls.
  • The lines are queued while the guest acts and sent once the command returns, because the hub isn't reachable from inside the command. The game mode packet (F3+F4) sends them too.

2. A guest's @s on the scoreboard is the guest

  • scoreboard players set @s obj 3 from a guest set the score of Player, the host's placeholder name. That name was also used for the guest's team, display name, and death and kill criteria.
  • They now use the acting player's name, as ScoreHolder.getScoreboardName does.

3. Commands name the guest who runs them

  • /give, /clear, /gamemode, /experience query, /advancement, /playsound's tracker and the whisper-to-yourself lines printed Player for the acting player. The harness caught it with Gave 1 [Raw Iron] to Player.
  • They now use a single helper, acting_player_name(). target_name and the scoreboard use it too.

Harness: dedicated_server

  • The op's console lines aren't filtered out any more. Before, System chat: [Tester: and Killed Tester were in NOT_YET.
  • The client now also runs three commands:
    • scoreboard objectives add parity dummy;
    • scoreboard players set @s parity 3, a broadcast that names the guest;
    • scoreboard players get @s parity, a query that must not reach the console.
  • These console lines are now compared with vanilla's:
    • [Tester: Changed the block at …];
    • [Tester: Gave 1 [Raw Iron] to Tester] and the coal;
    • [Tester: Created new objective [parity]];
    • [Tester: Set [parity] for Tester to 3];
    • [Tester: Killed Tester].
  • Guests' death messages and advancement announcements are still left out: they aren't Horizon's yet.

Not in this PR:

  • the console's own command feedback sent to op players (broadcast-console-to-ops);
  • LAN worlds, where the host is the operator. Both use the same mechanism and can follow.

Checks
Run on one branch holding main and both of today's server fixes (#733 and #734), then rechecked after merging main at 1e655afc:

  • cargo fmt --all --check: OK.
  • cargo clippy --workspace --all-targets -- -D warnings: 0 warnings (-p horizon-client again after the merge).
  • cargo test -p horizon-client --lib: 824 passed, 0 failed, 11 ignored.
  • tools/parity.py --changed origin/main: 89 of 89 harnesses passed, including server_world_gen and dedicated_server. world_spawn passed on its retry without reused oracle results.

🤖 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/734 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/17/2026 **Status:** ✅ Merged **Merged:** 10/17/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/guest-command-feedback` --- ### 📝 Commits (4) - [`91a4290`](https://github.com/horizon-rust/horizon/commit/91a4290f506bdf8e11488a0adb30ba659a059ed6) Guests' command feedback reaches the console and the other operators - [`e2f2177`](https://github.com/horizon-rust/horizon/commit/e2f2177b60239898b0f24c7d171c3200070101fb) Scoreboard: a guest's @s is the guest, not "Player" - [`8912d5d`](https://github.com/horizon-rust/horizon/commit/8912d5d26949e49eb2ad8fc6bc8fb6d60194e5df) dedicated_server harness: compare the op's command feedback on the console, and a score on @s - [`59fe284`](https://github.com/horizon-rust/horizon/commit/59fe284c7dd90dc3d08edd4d60190ef1793d04b8) Commands name the guest who runs them, not "Player" ### 📊 Changes **9 files changed** (+209 additions, -39 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+5 -0) 📝 `crates/horizon-client/src/game/commands.rs` (+51 -13) ➕ `crates/horizon-client/src/game/commands/admin.rs` (+92 -0) 📝 `crates/horizon-client/src/game/commands/world_cmds.rs` (+1 -2) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+27 -0) 📝 `crates/horizon-client/src/game/scoreboard.rs` (+16 -18) 📝 `crates/horizon-client/src/text.rs` (+4 -0) 📝 `mods/horizon/src/test/java/dev/horizonlab/parity/VanillaProtocolClient.java` (+5 -0) 📝 `tools/test_dedicated_server_parity.py` (+8 -6) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Two things server-host-3 found in how Horizon's dedicated server handles a guest's commands, plus a third found while testing them. Each now matches vanilla. **1. A guest's command feedback reaches the console and the other operators** (CommandSourceStack.broadcastToAdmins) - When an operator runs `/give @s coal`, vanilla's console logs `[Server thread/INFO]: System chat: [Tester: Gave 1 [Coal] to Tester]`. Every other operator also gets the line, gray and italic. - Horizon logged nothing and told no one. It now does both, on the dedicated server: - the console line when `log_admin_commands` is on; - the line to every other operator when `send_command_feedback` is on. - The replies vanilla sends with `broadcast` false stay with the player who asked. These are queries and lists such as `/seed`, `/time query`, `scoreboard players get`, `/data get` and `/locate`. The 85 keys are listed in `game/commands/admin.rs`, taken from vanilla's `sendSuccess(…, false)` calls. - The lines are queued while the guest acts and sent once the command returns, because the hub isn't reachable from inside the command. The game mode packet (F3+F4) sends them too. **2. A guest's `@s` on the scoreboard is the guest** - `scoreboard players set @s obj 3` from a guest set the score of `Player`, the host's placeholder name. That name was also used for the guest's team, display name, and death and kill criteria. - They now use the acting player's name, as `ScoreHolder.getScoreboardName` does. **3. Commands name the guest who runs them** - `/give`, `/clear`, `/gamemode`, `/experience query`, `/advancement`, `/playsound`'s tracker and the whisper-to-yourself lines printed `Player` for the acting player. The harness caught it with `Gave 1 [Raw Iron] to Player`. - They now use a single helper, `acting_player_name()`. `target_name` and the scoreboard use it too. **Harness: `dedicated_server`** - The op's console lines aren't filtered out any more. Before, `System chat: [Tester: ` and `Killed Tester` were in `NOT_YET`. - The client now also runs three commands: - `scoreboard objectives add parity dummy`; - `scoreboard players set @s parity 3`, a broadcast that names the guest; - `scoreboard players get @s parity`, a query that must not reach the console. - These console lines are now compared with vanilla's: - `[Tester: Changed the block at …]`; - `[Tester: Gave 1 [Raw Iron] to Tester]` and the coal; - `[Tester: Created new objective [parity]]`; - `[Tester: Set [parity] for Tester to 3]`; - `[Tester: Killed Tester]`. - Guests' death messages and advancement announcements are still left out: they aren't Horizon's yet. **Not in this PR:** - the console's own command feedback sent to op players (`broadcast-console-to-ops`); - LAN worlds, where the host is the operator. Both use the same mechanism and can follow. **Checks** Run on one branch holding `main` and both of today's server fixes (#733 and #734), then rechecked after merging `main` at `1e655afc`: - `cargo fmt --all --check`: OK. - `cargo clippy --workspace --all-targets -- -D warnings`: 0 warnings (`-p horizon-client` again after the merge). - `cargo test -p horizon-client --lib`: 824 passed, 0 failed, 11 ignored. - `tools/parity.py --changed origin/main`: 89 of 89 harnesses passed, including `server_world_gen` and `dedicated_server`. `world_spawn` passed on its retry without reused oracle results. 🤖 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-02 15:58:53 +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#2767
No description provided.