[PR #2098] [MERGED] Launcher: don't install a mod version the game can't run #4000

Closed
opened 2026-11-03 04:13:56 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: main ← Head: feat/launcher-mod-api-level


📝 Commits (2)

  • 3c22ff0 Launcher: don't install a mod version the game can't run
  • c8464c6 Merge branch 'feat/mod-api-level' into feat/launcher-mod-api-level

📊 Changes

6 files changed (+162 additions, -27 deletions)

View changed files

📝 crates/horizon-client/src/main.rs (+6 -0)
📝 crates/horizon-mods/src/api_level.rs (+35 -0)
📝 launcher/src/backend.rs (+49 -0)
📝 launcher/src/browser/horizon.rs (+44 -17)
📝 launcher/src/browser/horizon/pack.rs (+1 -1)
📝 launcher/src/browser/horizon/tests.rs (+27 -9)

📄 Description

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

Follows #2080 (mod API levels, merged).

#2080 makes the game refuse a too-new mod in plain words, and the index lists each version's level. This PR is the launcher side: the browser no longer installs a mod version the game can't run.

What players get

  • The game program says its level. horizon-client now carries horizon-mod-api-level:NNNN; (horizon_mods::api_level::MARK). main reads it, so the linker keeps it.
    • The launcher reads it from the installed version's program, once per version, without running the program.
    • A program from before the mark, 0.2.68 and older, counts as level 0. That is right for 0.2.67 and 0.2.68, the oldest the launcher keeps up to date.
  • The level used is that of the game the player runs: the selected version, else the newest installed one. With no version installed, nothing is marked: the launcher doesn't yet know which game will run the mod.
  • In the Horizon browser, a version above that level is marked "needs a newer Horizon than the game you play". The browser shows this through the same blocked field it uses for taken-down versions.
  • Installing takes the newest version the game can run. If every version needs a newer Horizon, the launcher says "Minimap needs a newer Horizon than the game you play: update it first." instead of installing a mod that won't start.
  • Indexes without levels behave as before.

Example: with v0.2.68 selected, Minimap 1.0.0 (level 1) shows as needing a newer Horizon. FPS Counter, Keystrokes and Zoom (level 0) install as before.

How tested

  • Launcher tests:
    • a_game_program_says_its_mod_api_level: a marked program reads its level; a program without the mark, or no program, reads 0.
    • versions_for_a_newer_horizon_are_not_installed:
      • with the game at level 0, a level-1 version is refused with the message and marked blocked;
      • at level 1, or with no level known, it installs.
    • The existing install tests run with no level known.
  • api_level test: read_mark finds the mark among look-alike prefixes and refuses a malformed one.
  • The built game: cargo build --profile fast -p horizon-client gives a program with horizon-mod-api-level:0001; in it (found by searching the binary). The macOS linker strips unreferenced data, which is why main reads the mark.

Leftover: a Horizon modpack's mods are installed at the versions the pack pins, without this check. The game still refuses a too-new one at start, with #2080's message.

Self-check against #2080's head:

pr_ready (tools/pr_ready.py --quick --base 6c995bfa1 on ludovics-mac-mini, against 6c995bfa1 at 6c995bfa1, 9 min 48 s)

Check Result
Scope ⚠️ 6 files, +162 −27; mixes game, launcher
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ➖ no Python change
rustfmt ✅ (32 s)
clippy ✅ (2 min 2 s)
tests: horizon-client, horizon-mods ✅ 1359 passed (5 min 28 s)
doc tests ✅ 0 passed (1 min 25 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (2 s)
launcher clippy ✅ (8 s)
launcher tests ✅ 132 passed (5 s)
Parity ➖ 29 affected, to run in CI (--quick): arrow, block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, hardcore_respawn, locator_bar, mace, online_mode and 17 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

No label: it fixes installing a mod that won't start.

🤖 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/2098 **Author:** [@ludovic111](https://github.com/ludovic111) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/launcher-mod-api-level` --- ### 📝 Commits (2) - [`3c22ff0`](https://github.com/horizon-rust/horizon/commit/3c22ff084916cf48ebdec3adb51ed9012ff5f0de) Launcher: don't install a mod version the game can't run - [`c8464c6`](https://github.com/horizon-rust/horizon/commit/c8464c6bff99faeb8896ccd4d946696ae0604497) Merge branch 'feat/mod-api-level' into feat/launcher-mod-api-level ### 📊 Changes **6 files changed** (+162 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/main.rs` (+6 -0) 📝 `crates/horizon-mods/src/api_level.rs` (+35 -0) 📝 `launcher/src/backend.rs` (+49 -0) 📝 `launcher/src/browser/horizon.rs` (+44 -17) 📝 `launcher/src/browser/horizon/pack.rs` (+1 -1) 📝 `launcher/src/browser/horizon/tests.rs` (+27 -9) </details> ### 📄 Description > 🤖 Opened by Ludovic's AI agent (Claude), not by Ludovic himself. Follows #2080 (mod API levels, merged). #2080 makes the game refuse a too-new mod in plain words, and the index lists each version's level. This PR is the launcher side: the browser no longer installs a mod version the game can't run. ## What players get - **The game program says its level.** `horizon-client` now carries `horizon-mod-api-level:NNNN;` (`horizon_mods::api_level::MARK`). `main` reads it, so the linker keeps it. - The launcher reads it from the installed version's program, once per version, without running the program. - A program from before the mark, 0.2.68 and older, counts as level 0. That is right for 0.2.67 and 0.2.68, the oldest the launcher keeps up to date. - **The level used is that of the game the player runs:** the selected version, else the newest installed one. With no version installed, nothing is marked: the launcher doesn't yet know which game will run the mod. - **In the Horizon browser,** a version above that level is marked "needs a newer Horizon than the game you play". The browser shows this through the same `blocked` field it uses for taken-down versions. - **Installing** takes the newest version the game can run. If every version needs a newer Horizon, the launcher says "Minimap needs a newer Horizon than the game you play: update it first." instead of installing a mod that won't start. - Indexes without levels behave as before. Example: with v0.2.68 selected, Minimap 1.0.0 (level 1) shows as needing a newer Horizon. FPS Counter, Keystrokes and Zoom (level 0) install as before. ## How tested - **Launcher tests:** - `a_game_program_says_its_mod_api_level`: a marked program reads its level; a program without the mark, or no program, reads 0. - `versions_for_a_newer_horizon_are_not_installed`: - with the game at level 0, a level-1 version is refused with the message and marked blocked; - at level 1, or with no level known, it installs. - The existing install tests run with no level known. - **`api_level` test:** `read_mark` finds the mark among look-alike prefixes and refuses a malformed one. - **The built game:** `cargo build --profile fast -p horizon-client` gives a program with `horizon-mod-api-level:0001;` in it (found by searching the binary). The macOS linker strips unreferenced data, which is why `main` reads the mark. Leftover: a Horizon modpack's mods are installed at the versions the pack pins, without this check. The game still refuses a too-new one at start, with #2080's message. **Self-check** against #2080's head: **pr_ready** (`tools/pr_ready.py --quick --base 6c995bfa1` on ludovics-mac-mini, against 6c995bfa1 at 6c995bfa1, 9 min 48 s) | Check | Result | | --- | --- | | Scope | ⚠️ 6 files, +162 −27; mixes game, launcher | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ➖ no Python change | | rustfmt | ✅ (32 s) | | clippy | ✅ (2 min 2 s) | | tests: horizon-client, horizon-mods | ✅ 1359 passed (5 min 28 s) | | doc tests | ✅ 0 passed (1 min 25 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (2 s) | | launcher clippy | ✅ (8 s) | | launcher tests | ✅ 132 passed (5 s) | | Parity | ➖ 29 affected, to run in CI (--quick): arrow, block_removal, command_exec, composter, crafter, cursor_death, dedicated_server, dispenser, hardcore_respawn, locator_bar, mace, online_mode and 17 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | No label: it fixes installing a mod that won't start. 🤖 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 04:13:56 +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#4000
No description provided.