[PR #5982] [MERGED] Management protocol: read and set live difficulty #6592

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

📋 Pull Request Information

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

Base: main ← Head: fix/server-management-difficulty


📝 Commits (1)

  • c05bd1a Add live difficulty methods to server management

📊 Changes

3 files changed (+73 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/dedicated/management.rs (+22 -0)
📝 crates/horizon-server/src/management_methods.rs (+32 -0)
📝 tools/test_management_protocol_parity.py (+19 -2)

📄 Description

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

What and why

Part of #5147 (roadmap:server-admin). Vanilla management clients can now read and set the server's live difficulty through minecraft:serversettings/difficulty and minecraft:serversettings/difficulty/set. A change updates the world and players immediately, keeps hardcore worlds on Hard, and saves the chosen server property and Horizon configuration so a restart retains it.

This is the second small server-management PR. It is based on upstream main independently of PR #5940; its changes can be reviewed on their own.

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

MinecraftServerSettingsServiceImpl.getDifficulty and setDifficulty, DedicatedServer.setDifficulty and forceDifficulty. The management-protocol harness compares live reads and changes to Hard and Peaceful with vanilla, then compares the saved server.properties difficulty.

Other projects' code

None.

Self-check

  • Vanilla versus Horizon: 49/49 management-protocol replies matched, including the five new difficulty requests. Both saved difficulty=peaceful in server.properties; Horizon also saved it in server.toml. The harness stopped at its separate schema check because this machine lacks the ignored .local/datagen report; the wire and persistence comparisons completed and matched.

pr_ready (tools/pr_ready.py --quick --base upstream/main against upstream/main at 8c02c0b85, 8 min 48 s)

Check Result
Scope ✅ 3 committed files, +73 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 515 passed (46 s)
rustfmt ✅ (6 s)
clippy ✅ (1 min 15 s)
tests: horizon-client, horizon-server ✅ 1787 passed (5 min 59 s)
doc tests ✅ 0 passed (41 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Report omits machine identity; scope excludes unrelated untracked local files.


🔄 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/5982 **Author:** [@TiggerTakkyTTT](https://github.com/TiggerTakkyTTT) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/server-management-difficulty` --- ### 📝 Commits (1) - [`c05bd1a`](https://github.com/horizon-rust/horizon/commit/c05bd1a78c04c702e592a8519564495053deb7f4) Add live difficulty methods to server management ### 📊 Changes **3 files changed** (+73 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/dedicated/management.rs` (+22 -0) 📝 `crates/horizon-server/src/management_methods.rs` (+32 -0) 📝 `tools/test_management_protocol_parity.py` (+19 -2) </details> ### 📄 Description > 🤖 Opened by TiggerTakkyTTT's AI agent (Codex, GPT-6), not by TiggerTakkyTTT personally. ## What and why Part of #5147 (`roadmap:server-admin`). Vanilla management clients can now read and set the server's live difficulty through `minecraft:serversettings/difficulty` and `minecraft:serversettings/difficulty/set`. A change updates the world and players immediately, keeps hardcore worlds on Hard, and saves the chosen server property and Horizon configuration so a restart retains it. This is the second small server-management PR. It is based on upstream main independently of PR #5940; its changes can be reviewed on their own. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference `MinecraftServerSettingsServiceImpl.getDifficulty` and `setDifficulty`, `DedicatedServer.setDifficulty` and `forceDifficulty`. The management-protocol harness compares live reads and changes to Hard and Peaceful with vanilla, then compares the saved `server.properties` difficulty. ## Other projects' code None. ## Self-check - Vanilla versus Horizon: 49/49 management-protocol replies matched, including the five new difficulty requests. Both saved `difficulty=peaceful` in `server.properties`; Horizon also saved it in `server.toml`. The harness stopped at its separate schema check because this machine lacks the ignored `.local/datagen` report; the wire and persistence comparisons completed and matched. **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` against upstream/main at 8c02c0b85, 8 min 48 s) | Check | Result | | --- | --- | | Scope | ✅ 3 committed files, +73 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 515 passed (46 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (1 min 15 s) | | tests: horizon-client, horizon-server | ✅ 1787 passed (5 min 59 s) | | doc tests | ✅ 0 passed (41 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Report omits machine identity; scope excludes unrelated untracked local files. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:23:32 +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#6592
No description provided.