[PR #5463] [MERGED] horizon-server: the management protocol changes the allowlist and the bans #6304

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

📋 Pull Request Information

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

Base: main ← Head: server-admin/management-lists


📝 Commits (1)

  • 644657e horizon-server: the management protocol changes the allowlist and the bans

📊 Changes

11 files changed (+372 additions, -20 deletions)

View changed files

📝 crates/horizon-client/src/game/dedicated.rs (+1 -0)
➕ crates/horizon-client/src/game/dedicated/management.rs (+174 -0)
📝 crates/horizon-client/src/game/dedicated/status.rs (+3 -1)
📝 crates/horizon-server-files/src/profiles.rs (+21 -0)
📝 crates/horizon-server-files/src/user_cache.rs (+17 -0)
📝 crates/horizon-server-files/src/user_lists.rs (+24 -0)
📝 crates/horizon-server/src/management.rs (+18 -9)
📝 crates/horizon-server/src/management_methods.rs (+85 -3)
📝 docs/api/server.md (+3 -2)
📝 docs/server.md (+5 -3)
📝 tools/test_management_protocol_parity.py (+21 -2)

📄 Description

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

Roadmap server-admin, part 6d: vanilla's management protocol changes the allowlist and the bans: allowlist/{add,remove,set,clear} and bans/{add,remove,set,clear}. They work as vanilla 26.3's AllowlistService and BanlistService.

  • The supervisor checks the parameters (PlayerDtos, UserBanDtos with an ISO-8601 expires). It forwards each edit to the running game on its control endpoint as management <connection> <json>, then answers with the list read from its file, as #5345's getters do.
  • The game applies the edit (game/dedicated/management.rs):
    • Finding players, as MinecraftPlayerListService.getUser does: by id, the user cache, else the session service; by name, the user cache, else the profile service, else an offline player.
    • Applying: add, remove and clear change the list as StoredUserList does. set computes the same difference vanilla does: a ban equals another when player, reason, source and end match.
    • Bans: the source is "Management server" unless the request gives one, and the ban starts now.
    • Logging: each change is logged as JsonRpcLogger logs it, e.g. RPC Connection #2: Add player 'Kim0' to banlist. Reason: 'spam'. Connections are numbered from 1, as in vanilla.
    • Kicks: a banned player who is online is disconnected with multiplayer.disconnect.banned. After allowlist/remove or allowlist/set, unlisted players are kicked when enforce-whitelist is on.
  • horizon-server-files gains UserList::clear (Java's HashMap.clear keeps its table, so later entries are written in the same order), UserCache::get_by_id and profiles::find_by_id (the discovery document's session/getProfileById).

Parity harness. tools/test_management_protocol_parity.py now also adds, removes, sets and clears both servers' allowlist and bans: names, an id the cache knows, a reason, an expiry and a custom source. It compares every answer (42 exchanges over TLS), and passed against vanilla 26.3 on the Mac mini. The first run showed that names depend on the network: vanilla timed out reaching Mojang and fell back to an offline player, while Horizon found a real account. Both servers now get a profile service that doesn't answer (-Dminecraft.api.discovery.host / HORIZON_API_DISCOVERY, as test_command_exec_parity.py does), so names resolve to the same offline players.

lan_bot fails, and not because of this PR. crates/horizon-client/tests/lan_bot.rs fails 13 tests on minecraft:dialog: registry data is sent despite the known pack. The cause is main at 525dcdccd: this PR changes no LAN or registry code, only the dedicated server's control requests (bin) and three additive functions in horizon-server-files. #4698 (quick actions, which brings dialogs) merged just before. The other 1544 tests pass, and so does horizon-server (81).

pr_ready (tools/pr_ready.py --quick on ludovics-mac-mini, against origin/main at 525dcdccd, 17 min 12 s)

Check Result
Scope ✅ 11 files, +372 −20
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 508 passed (1 min 36 s)
rustfmt ✅ (5 s)
clippy ✅ (2 min 29 s)
tests: horizon-client, horizon-server, horizon-server-files ❌ 1544 passed, 13 failed (9 min 39 s)
doc tests ✅ 0 passed (2 min 32 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 ➖ 40 affected, to run in CI (--quick): blending, block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, held_item_stack and 28 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 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/5463 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `server-admin/management-lists` --- ### 📝 Commits (1) - [`644657e`](https://github.com/horizon-rust/horizon/commit/644657ec4db64ad2c3064afb6c261ed50b6e7f83) horizon-server: the management protocol changes the allowlist and the bans ### 📊 Changes **11 files changed** (+372 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/dedicated.rs` (+1 -0) ➕ `crates/horizon-client/src/game/dedicated/management.rs` (+174 -0) 📝 `crates/horizon-client/src/game/dedicated/status.rs` (+3 -1) 📝 `crates/horizon-server-files/src/profiles.rs` (+21 -0) 📝 `crates/horizon-server-files/src/user_cache.rs` (+17 -0) 📝 `crates/horizon-server-files/src/user_lists.rs` (+24 -0) 📝 `crates/horizon-server/src/management.rs` (+18 -9) 📝 `crates/horizon-server/src/management_methods.rs` (+85 -3) 📝 `docs/api/server.md` (+3 -2) 📝 `docs/server.md` (+5 -3) 📝 `tools/test_management_protocol_parity.py` (+21 -2) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Roadmap `server-admin`, part 6d: vanilla's management protocol changes the allowlist and the bans: `allowlist/{add,remove,set,clear}` and `bans/{add,remove,set,clear}`. They work as vanilla 26.3's `AllowlistService` and `BanlistService`. - The supervisor checks the parameters (`PlayerDto`s, `UserBanDto`s with an ISO-8601 `expires`). It forwards each edit to the running game on its control endpoint as `management <connection> <json>`, then answers with the list read from its file, as #5345's getters do. - The game applies the edit (`game/dedicated/management.rs`): - **Finding players**, as `MinecraftPlayerListService.getUser` does: by id, the user cache, else the session service; by name, the user cache, else the profile service, else an offline player. - **Applying**: `add`, `remove` and `clear` change the list as `StoredUserList` does. `set` computes the same difference vanilla does: a ban equals another when player, reason, source and end match. - **Bans**: the source is "Management server" unless the request gives one, and the ban starts now. - **Logging**: each change is logged as `JsonRpcLogger` logs it, e.g. `RPC Connection #2: Add player 'Kim0' to banlist. Reason: 'spam'`. Connections are numbered from 1, as in vanilla. - **Kicks**: a banned player who is online is disconnected with `multiplayer.disconnect.banned`. After `allowlist/remove` or `allowlist/set`, unlisted players are kicked when `enforce-whitelist` is on. - horizon-server-files gains `UserList::clear` (Java's `HashMap.clear` keeps its table, so later entries are written in the same order), `UserCache::get_by_id` and `profiles::find_by_id` (the discovery document's `session`/`getProfileById`). **Parity harness.** `tools/test_management_protocol_parity.py` now also adds, removes, sets and clears both servers' allowlist and bans: names, an id the cache knows, a reason, an expiry and a custom source. It compares every answer (42 exchanges over TLS), and passed against vanilla 26.3 on the Mac mini. The first run showed that names depend on the network: vanilla timed out reaching Mojang and fell back to an offline player, while Horizon found a real account. Both servers now get a profile service that doesn't answer (`-Dminecraft.api.discovery.host` / `HORIZON_API_DISCOVERY`, as `test_command_exec_parity.py` does), so names resolve to the same offline players. **lan_bot fails, and not because of this PR.** `crates/horizon-client/tests/lan_bot.rs` fails 13 tests on `minecraft:dialog`: registry data is sent despite the known pack. The cause is main at 525dcdccd: this PR changes no LAN or registry code, only the dedicated server's control requests (bin) and three additive functions in horizon-server-files. #4698 (quick actions, which brings dialogs) merged just before. The other 1544 tests pass, and so does `horizon-server` (81). **pr_ready** (`tools/pr_ready.py --quick` on ludovics-mac-mini, against origin/main at 525dcdccd, 17 min 12 s) | Check | Result | | --- | --- | | Scope | ✅ 11 files, +372 −20 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 508 passed (1 min 36 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (2 min 29 s) | | tests: horizon-client, horizon-server, horizon-server-files | ❌ 1544 passed, 13 failed (9 min 39 s) | | doc tests | ✅ 0 passed (2 min 32 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 | ➖ 40 affected, to run in CI (--quick): blending, block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, held_item_stack and 28 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 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 06:18:01 +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#6304
No description provided.