[PR #4547] [MERGED] Dedicated server: horizon-clients-only, an opt-in gate for the Horizon client #5689

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

📋 Pull Request Information

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

Base: main ← Head: feat/horizon-clients-only


📝 Commits (1)

  • 7a4f7d5 Dedicated server: horizon-clients-only lets only the Horizon client join

📊 Changes

6 files changed (+173 additions, -2 deletions)

View changed files

📝 crates/horizon-bots/src/main.rs (+21 -2)
📝 crates/horizon-client/src/game/dedicated.rs (+4 -0)
📝 crates/horizon-client/src/lan/conn.rs (+15 -0)
📝 crates/horizon-client/src/lan/mod.rs (+11 -0)
📝 docs/hosting.md (+5 -0)
➕ tools/server_horizon_only_e2e.py (+117 -0)

📄 Description

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

What and why

An owner can let only the Horizon client join their server. Ludovic wants this on the official server: only Horizon clients, nothing for players to install beyond Horizon itself. Off by default: vanilla's behaviour is unchanged unless the owner turns it on.

# server.toml
[properties]
horizon-clients-only = true

When it's on, the server reads the minecraft:brand a client sends during configuration. Horizon's client sends "horizon" (net.rs, brand()), vanilla's sends "vanilla", and a client that sends none counts as "vanilla", as on vanilla's server. Any other brand is disconnected before it joins, with:

This server is for the Horizon client: playhorizon.dev

The console says which client it was: Disconnecting Steve: its client is "vanilla", not Horizon (horizon-clients-only), then vanilla's lost connection line.

A brand can be spoofed. Any client can send "horizon", so this is a gate, not security: it keeps out players who didn't install Horizon, not cheaters. What protects the server is its own checks: vanilla's reach checks (#4531) and the anticheat, which is off by default and coming in its own PRs. docs/hosting.md says so too.

horizon:hello: the client could also send a horizon:hello payload with its version during configuration (vanilla servers ignore unknown payloads). It isn't needed for this gate, and requiring it would turn away every Horizon client released before it. It can come later if a server needs to require a minimum version.

The key is read like horizon-pregen, straight from the raw server.properties, so the file vanilla's code writes stays vanilla's (server_files parity).

Vanilla reference

ServerConfigurationPacketListenerImpl.handleCustomPayload / ServerCommonPacketListenerImpl (minecraft:brand, ClientBrandRetriever.VANILLA_NAME); the disconnect is vanilla's configuration ClientboundDisconnectPacket.

Tests

tools/server_horizon_only_e2e.py (new), on a real dedicated server with horizon-bots (new --brand; a configuration disconnect's reason is now in the bot's report):

  • off: a client without a brand joins;
  • on: no brand and "vanilla" are turned away with the message and the console line; "horizon" joins.

Harnesses (Mac mini, this head): tools/parity.py dedicated_server server_entities server_player_damage server_files: 4 passed, 0 failed.

pr_ready (tools/pr_ready.py --quick --base 9ab3cee2e8f87fdd7396f6aaaacf71f022788aaa on ludovics-mac-mini, against 9ab3cee2e8 at 9ab3cee2e, 9 min 8 s)

Check Result
Scope ✅ 6 files, +173 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 481 passed (1 min 56 s)
rustfmt ✅ (5 s)
clippy ✅ (2 min 7 s)
tests: horizon-bots, horizon-client ✅ 1067 passed (4 min 32 s)
doc tests ✅ 0 passed (4 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 ➖ 35 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, lan_integration, lan and 23 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/4547 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/horizon-clients-only` --- ### 📝 Commits (1) - [`7a4f7d5`](https://github.com/horizon-rust/horizon/commit/7a4f7d5c99dccf7acc2d600b93969bd698c5bcc0) Dedicated server: horizon-clients-only lets only the Horizon client join ### 📊 Changes **6 files changed** (+173 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-bots/src/main.rs` (+21 -2) 📝 `crates/horizon-client/src/game/dedicated.rs` (+4 -0) 📝 `crates/horizon-client/src/lan/conn.rs` (+15 -0) 📝 `crates/horizon-client/src/lan/mod.rs` (+11 -0) 📝 `docs/hosting.md` (+5 -0) ➕ `tools/server_horizon_only_e2e.py` (+117 -0) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. ## What and why An owner can let only the Horizon client join their server. Ludovic wants this on the official server: only Horizon clients, nothing for players to install beyond Horizon itself. **Off by default**: vanilla's behaviour is unchanged unless the owner turns it on. ```toml # server.toml [properties] horizon-clients-only = true ``` When it's on, the server reads the `minecraft:brand` a client sends during configuration. Horizon's client sends `"horizon"` (`net.rs`, `brand()`), vanilla's sends `"vanilla"`, and a client that sends none counts as `"vanilla"`, as on vanilla's server. Any other brand is disconnected before it joins, with: > This server is for the Horizon client: playhorizon.dev The console says which client it was: `Disconnecting Steve: its client is "vanilla", not Horizon (horizon-clients-only)`, then vanilla's `lost connection` line. **A brand can be spoofed.** Any client can send `"horizon"`, so this is a gate, not security: it keeps out players who didn't install Horizon, not cheaters. What protects the server is its own checks: vanilla's reach checks (#4531) and the anticheat, which is off by default and coming in its own PRs. docs/hosting.md says so too. **`horizon:hello`:** the client could also send a `horizon:hello` payload with its version during configuration (vanilla servers ignore unknown payloads). It isn't needed for this gate, and requiring it would turn away every Horizon client released before it. It can come later if a server needs to require a minimum version. The key is read like `horizon-pregen`, straight from the raw `server.properties`, so the file vanilla's code writes stays vanilla's (`server_files` parity). ## Vanilla reference `ServerConfigurationPacketListenerImpl.handleCustomPayload` / `ServerCommonPacketListenerImpl` (`minecraft:brand`, `ClientBrandRetriever.VANILLA_NAME`); the disconnect is vanilla's configuration `ClientboundDisconnectPacket`. ## Tests `tools/server_horizon_only_e2e.py` (new), on a real dedicated server with horizon-bots (new `--brand`; a configuration disconnect's reason is now in the bot's report): - off: a client without a brand joins; - on: no brand and `"vanilla"` are turned away with the message and the console line; `"horizon"` joins. **Harnesses** (Mac mini, this head): `tools/parity.py dedicated_server server_entities server_player_damage server_files`: 4 passed, 0 failed. **pr_ready** (`tools/pr_ready.py --quick --base 9ab3cee2e8f87fdd7396f6aaaacf71f022788aaa` on ludovics-mac-mini, against 9ab3cee2e8f87fdd7396f6aaaacf71f022788aaa at 9ab3cee2e, 9 min 8 s) | Check | Result | | --- | --- | | Scope | ✅ 6 files, +173 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 481 passed (1 min 56 s) | | rustfmt | ✅ (5 s) | | clippy | ✅ (2 min 7 s) | | tests: horizon-bots, horizon-client | ✅ 1067 passed (4 min 32 s) | | doc tests | ✅ 0 passed (4 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 | ➖ 35 affected, to run in CI (--quick): block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, forced_end, friends_integration, hardcore_respawn, lan_integration, lan and 23 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 05:14:20 +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#5689
No description provided.