[PR #6616] [MERGED] Add live default game mode to server management #6985

Closed
opened 2026-11-03 06:30:51 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6616
Author: @TiggerTakkyTTT
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/server-management-game-mode


📝 Commits (1)

  • 3a9559f Add live default game mode to server management

📊 Changes

4 files changed (+69 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/dedicated.rs (+3 -0)
📝 crates/horizon-client/src/game/dedicated/management.rs (+20 -1)
📝 crates/horizon-server/src/management_methods.rs (+32 -0)
📝 tools/test_management_protocol_parity.py (+14 -1)

📄 Description

🤖 Opened by TiggerTakkyTTT's AI agent (Codex, GPT-6), not by TiggerTakkyTTT personally.

What and why

Part of #6597. Implement the advertised minecraft:serversettings/game_mode and /set methods. Management clients can read and change the default game mode while the dedicated server runs. The change updates server.properties, server.toml, the world default, and online players when forced game mode is enabled.

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

MinecraftServerSettingsServiceImpl.getGameMode and setGameMode, DedicatedServer.gameMode and setGameMode, and MinecraftServer.enforceGameTypeForPlayers in the official 26.3 game code.

Extended tools/test_management_protocol_parity.py with five read/set calls and saved-setting checks. In an isolated protocol run using the installed 26.3 client jar's dedicated-server classes, all 59 JSON-RPC replies and six connection checks matched Horizon; both servers saved gamemode=spectator. The generated schema report was unavailable locally, so that independent comparison did not run.

Other projects' code

None.

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main, against upstream/main at 6ed2d97cd, 12 min 32 s)

Check Result
Scope ✅ 4 committed files, +69 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 595 passed (1 min 26 s)
rustfmt ✅ (1 min 37 s)
clippy ✅ (4 min 2 s)
tests: horizon-client, horizon-server ✅ 705 passed (4 min 24 s)
doc tests ✅ 0 passed (1 min 3 s)
Parity ➖ not run by pr_ready --quick; supplemental protocol run above

🔄 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/6616 **Author:** [@TiggerTakkyTTT](https://github.com/TiggerTakkyTTT) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/server-management-game-mode` --- ### 📝 Commits (1) - [`3a9559f`](https://github.com/horizon-rust/horizon/commit/3a9559fe3c0f02585104584ac972470d9c774c7b) Add live default game mode to server management ### 📊 Changes **4 files changed** (+69 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/dedicated.rs` (+3 -0) 📝 `crates/horizon-client/src/game/dedicated/management.rs` (+20 -1) 📝 `crates/horizon-server/src/management_methods.rs` (+32 -0) 📝 `tools/test_management_protocol_parity.py` (+14 -1) </details> ### 📄 Description > 🤖 Opened by TiggerTakkyTTT's AI agent (Codex, GPT-6), not by TiggerTakkyTTT personally. ## What and why Part of #6597. Implement the advertised `minecraft:serversettings/game_mode` and `/set` methods. Management clients can read and change the default game mode while the dedicated server runs. The change updates `server.properties`, `server.toml`, the world default, and online players when forced game mode is enabled. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference `MinecraftServerSettingsServiceImpl.getGameMode` and `setGameMode`, `DedicatedServer.gameMode` and `setGameMode`, and `MinecraftServer.enforceGameTypeForPlayers` in the official 26.3 game code. Extended `tools/test_management_protocol_parity.py` with five read/set calls and saved-setting checks. In an isolated protocol run using the installed 26.3 client jar's dedicated-server classes, all 59 JSON-RPC replies and six connection checks matched Horizon; both servers saved `gamemode=spectator`. The generated schema report was unavailable locally, so that independent comparison did not run. ## Other projects' code None. ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main`, against upstream/main at 6ed2d97cd, 12 min 32 s) | Check | Result | | --- | --- | | Scope | ✅ 4 committed files, +69 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 595 passed (1 min 26 s) | | rustfmt | ✅ (1 min 37 s) | | clippy | ✅ (4 min 2 s) | | tests: horizon-client, horizon-server | ✅ 705 passed (4 min 24 s) | | doc tests | ✅ 0 passed (1 min 3 s) | | Parity | ➖ not run by `pr_ready --quick`; supplemental protocol run above | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:30:51 +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#6985
No description provided.