[PR #7209] [MERGED] Join check: name the content mods that differ, by version and file hash #7413

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

📋 Pull Request Information

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

Base: main ← Head: feat/mod-list-join-check


📝 Commits (6)

  • a2c3455 Join check: name the content mods that differ, by version and file hash
  • 21866d2 Join check: send only the shared mods
  • 18e168c Join check: hash the mods' files once, not on every pack reload
  • 3de28e2 Merge main into #7209
  • 08c5ffc docs: the join check sends only side = "both" mods; a manifest without a side is client
  • ca7459f Merge the author's docs update into #7209

📊 Changes

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

View changed files

📝 crates/horizon-client/src/game/mods.rs (+38 -2)
📝 crates/horizon-client/src/lan/conn.rs (+40 -0)
📝 crates/horizon-client/src/net.rs (+11 -0)
📝 crates/horizon-protocol/src/lib.rs (+1 -0)
➕ crates/horizon-protocol/src/mod_list.rs (+348 -0)
📝 docs/mods.md (+9 -0)

📄 Description

🤖 Opened by Obstacleee's AI agent (Claude Code, Claude Sonnet 5.5), not by Obstacleee personally.

Closes #7192.

A server with content mods now checks them one by one when a Horizon client joins, and names the ones that differ.

  • horizon_protocol::mod_list (channel horizon:mod_list): the server sends each loaded content mod's id, version, side and the SHA-256 of its .hmod; the client answers with its own list; the server compares and refuses a client that differs: missing, not on this server, other version, or same version with a changed file.
  • Only side = "both" mods count, so a client-only HUD or minimap never blocks a join and a server-only mod is the server's business.
  • A mod run from a folder (--dev-mod) has no file hash and matches by version.
  • Not in this PR: native mods (their manifest has no side), a registry allow-list and revocation, and syncing missing mods.

The registry hash (horizon:block_registry) only sees ids, so a .hmod with an edited loot table or recipe used to join. It no longer does.

Tested

  • 7 unit tests in mod_list.rs (round trip, caps, each kind of difference, side rules, folder mods, long lists).
  • By hand, a dedicated server with ruby.hmod and two clients, release fast profile, scratch folders: the client with the same file joined; the client with a ruby.hmod of the same id and version but another loot table was refused with Different version or file: ruby.
  • cargo fmt, tests of horizon-protocol. clippy -D warnings is clean for the touched files; it still reports 4 manual_range_contains in game/dragon.rs and 1 in horizon-world (not touched here, from a newer local toolchain). tools/pr_ready.py and the harnesses were not run (no .local/ here).

🤖 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/7209 **Author:** [@Obstacleee](https://github.com/Obstacleee) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/mod-list-join-check` --- ### 📝 Commits (6) - [`a2c3455`](https://github.com/horizon-rust/horizon/commit/a2c34553d89e6e5480170c42aeb6e61c4af58d15) Join check: name the content mods that differ, by version and file hash - [`21866d2`](https://github.com/horizon-rust/horizon/commit/21866d28e28b91ca353defcea285574d88a8de40) Join check: send only the shared mods - [`18e168c`](https://github.com/horizon-rust/horizon/commit/18e168cf9bdf8c913d4f886a623d10c18dcdf5e1) Join check: hash the mods' files once, not on every pack reload - [`3de28e2`](https://github.com/horizon-rust/horizon/commit/3de28e2331606b25ccdbb2eda0a27fa73b82388d) Merge main into #7209 - [`08c5ffc`](https://github.com/horizon-rust/horizon/commit/08c5ffc3d3c3afcea5c8ff6256746d4897922fd2) docs: the join check sends only side = "both" mods; a manifest without a side is client - [`ca7459f`](https://github.com/horizon-rust/horizon/commit/ca7459f68d1d786297ff6621ebbcba31759ac8e5) Merge the author's docs update into #7209 ### 📊 Changes **6 files changed** (+447 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/mods.rs` (+38 -2) 📝 `crates/horizon-client/src/lan/conn.rs` (+40 -0) 📝 `crates/horizon-client/src/net.rs` (+11 -0) 📝 `crates/horizon-protocol/src/lib.rs` (+1 -0) ➕ `crates/horizon-protocol/src/mod_list.rs` (+348 -0) 📝 `docs/mods.md` (+9 -0) </details> ### 📄 Description > 🤖 Opened by Obstacleee's AI agent (Claude Code, Claude Sonnet 5.5), not by Obstacleee personally. Closes #7192. A server with content mods now checks them one by one when a Horizon client joins, and names the ones that differ. - `horizon_protocol::mod_list` (channel `horizon:mod_list`): the server sends each loaded content mod's id, version, `side` and the SHA-256 of its `.hmod`; the client answers with its own list; the server compares and refuses a client that differs: missing, not on this server, other version, or same version with a changed file. - Only `side = "both"` mods count, so a client-only HUD or minimap never blocks a join and a server-only mod is the server's business. - A mod run from a folder (`--dev-mod`) has no file hash and matches by version. - Not in this PR: native mods (their manifest has no `side`), a registry allow-list and revocation, and syncing missing mods. The registry hash (`horizon:block_registry`) only sees ids, so a `.hmod` with an edited loot table or recipe used to join. It no longer does. ## Tested - 7 unit tests in `mod_list.rs` (round trip, caps, each kind of difference, side rules, folder mods, long lists). - By hand, a dedicated server with `ruby.hmod` and two clients, release `fast` profile, scratch folders: the client with the same file joined; the client with a `ruby.hmod` of the same id and version but another loot table was refused with `Different version or file: ruby`. - `cargo fmt`, tests of `horizon-protocol`. `clippy -D warnings` is clean for the touched files; it still reports 4 `manual_range_contains` in `game/dragon.rs` and 1 in `horizon-world` (not touched here, from a newer local toolchain). `tools/pr_ready.py` and the harnesses were not run (no `.local/` here). 🤖 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:39:12 +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#7413
No description provided.