[PR #5513] [MERGED] --player-dir: one player's own files when several games share a game folder (#4952, 2/3) #6329

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

📋 Pull Request Information

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

Base: main ← Head: accounts/player-dir


📝 Commits (6)

  • 0294c11 --player-dir: one player's own files when several games share a game folder
  • 1c8a721 Merge remote-tracking branch 'origin/main' into accounts/player-dir
  • 022472c Merge remote-tracking branch 'origin/main' into accounts/player-dir
  • de25a4d Merge main into #5513
  • dbe1507 --player-dir: crash telemetry keeps the home's consent, servers ignore it; tests and documented limits
  • 9d56f33 --player-dir: rustfmt

📊 Changes

14 files changed (+151 additions, -34 deletions)

View changed files

📝 crates/horizon-client-render/src/crash.rs (+2 -1)
📝 crates/horizon-client-render/src/logging.rs (+63 -0)
📝 crates/horizon-client-render/src/settings.rs (+3 -2)
📝 crates/horizon-client/src/game.rs (+13 -6)
📝 crates/horizon-client/src/game/chat.rs (+1 -3)
📝 crates/horizon-client/src/game/launch_api.rs (+5 -0)
📝 crates/horizon-client/src/game/mods.rs (+3 -5)
📝 crates/horizon-client/src/game/native_hooks.rs (+8 -8)
📝 crates/horizon-client/src/game/options.rs (+11 -6)
📝 crates/horizon-client/src/game/startup_menu.rs (+1 -1)
📝 crates/horizon-client/src/main.rs (+13 -1)
📝 crates/horizon-client/src/multiplayer.rs (+22 -0)
📝 docs/api/launch-reference.md (+5 -0)
📝 docs/api/launch.md (+1 -1)

📄 Description

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

What and why

Part 2 of #4952 (several accounts from one instance at the same time). Part 1, the launcher's play --account and --offline-name, is #5023.

Two games playing in one game folder at once fight over its per-player files:

  • one options.txt;
  • one logs/latest.log: the second game finds it locked and logs to the terminal only;
  • one generated name in horizon-player.txt: two offline players get one UUID, and the second one is refused as "logged in from another location";
  • one servers.dat.

horizon-client --player-dir DIR puts one player's own files in DIR:

  • options.txt and the settings files beside it (horizon-extras.txt, horizon-graphics.txt, the controller's);
  • logs/ and crash-reports/ (main.rs reads the option before the log opens, as it does --home);
  • horizon-player.txt, servers.dat, hotbar.nbt and screenshots/.

What the game folder's players share stays in the game folder: saves, resource and shader packs, and mods. That includes the enabled-mods list (logging::shared_dir) and native mods' config/, which so far followed options.txt's folder and now follow the game folder (Game::game_dir). Without the option nothing moves: player_dir() is the working directory, where options.txt already was.

The Launch API lists the option. 0.1.0 isn't released yet, so it joins 0.1.0's list (docs/api/launch.md, the regenerated reference) rather than making a 0.1.1. Main is merged in: its narrator start sits beside the settings, which now load from Game::options_path(). The launcher will pass it only to versions whose --launch-api reply lists it. That change is ready on Solenopsisbot:accounts/launcher-player-dir, on top of #5023.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

None: vanilla's --gameDir has no per-player part. Horizon-only, and nothing changes without the option.

Self-check

pr_ready (tools/pr_ready.py on cytonic, against origin/main at 9d979caa4, 35 min 9 s)

Check Result
Scope ✅ 14 files, +107 −37
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 495 passed (43 s)
rustfmt ✅ (8 s)
clippy ✅ (1 min 22 s)
tests: horizon-client, horizon-client-render ✅ 2040 passed (4 min 45 s)
doc tests ✅ 0 passed (3 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 ✅ 113 affected, 112 passed (27 min 58 s)

By hand on Linux (Vulkan, GTX 970, --offscreen):

  • Two games started at once in one folder with --player-dir players/Alice and players/Bob each logged to its own players/<name>/logs/latest.log; neither fell back to the terminal. Both saved their worlds in the shared saves/.
  • A third, without --name, kept options.txt (after horizon-ctl options-set renderDistance 6), horizon-graphics.txt and its generated horizon-player.txt in players/Carol/, and nothing per-player in the game folder.

🤖 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/5513 **Author:** [@Solenopsisbot](https://github.com/Solenopsisbot) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `accounts/player-dir` --- ### 📝 Commits (6) - [`0294c11`](https://github.com/horizon-rust/horizon/commit/0294c117fefdd0b0bb0d678f80ef2e6c3e2a7682) --player-dir: one player's own files when several games share a game folder - [`1c8a721`](https://github.com/horizon-rust/horizon/commit/1c8a721deefad849bd7d36f4826402c3f138a574) Merge remote-tracking branch 'origin/main' into accounts/player-dir - [`022472c`](https://github.com/horizon-rust/horizon/commit/022472cea822320bf4a43f18833c3c0624f01ff0) Merge remote-tracking branch 'origin/main' into accounts/player-dir - [`de25a4d`](https://github.com/horizon-rust/horizon/commit/de25a4d0a6b83b897f5ca10033f54db964b8f468) Merge main into #5513 - [`dbe1507`](https://github.com/horizon-rust/horizon/commit/dbe150799f9893d1381acc9c6af8e11763976494) --player-dir: crash telemetry keeps the home's consent, servers ignore it; tests and documented limits - [`9d56f33`](https://github.com/horizon-rust/horizon/commit/9d56f3371a9f28d63d52f4e2d6684d56700dee2b) --player-dir: rustfmt ### 📊 Changes **14 files changed** (+151 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/crash.rs` (+2 -1) 📝 `crates/horizon-client-render/src/logging.rs` (+63 -0) 📝 `crates/horizon-client-render/src/settings.rs` (+3 -2) 📝 `crates/horizon-client/src/game.rs` (+13 -6) 📝 `crates/horizon-client/src/game/chat.rs` (+1 -3) 📝 `crates/horizon-client/src/game/launch_api.rs` (+5 -0) 📝 `crates/horizon-client/src/game/mods.rs` (+3 -5) 📝 `crates/horizon-client/src/game/native_hooks.rs` (+8 -8) 📝 `crates/horizon-client/src/game/options.rs` (+11 -6) 📝 `crates/horizon-client/src/game/startup_menu.rs` (+1 -1) 📝 `crates/horizon-client/src/main.rs` (+13 -1) 📝 `crates/horizon-client/src/multiplayer.rs` (+22 -0) 📝 `docs/api/launch-reference.md` (+5 -0) 📝 `docs/api/launch.md` (+1 -1) </details> ### 📄 Description > 🤖 Opened by Solenopsisbot's AI agent (Claude Code, Claude Opus 5.5), not by Solenopsisbot personally. ## What and why Part 2 of #4952 (several accounts from one instance at the same time). Part 1, the launcher's `play --account` and `--offline-name`, is #5023. Two games playing in one game folder at once fight over its per-player files: - one `options.txt`; - one `logs/latest.log`: the second game finds it locked and logs to the terminal only; - one generated name in `horizon-player.txt`: two offline players get one UUID, and the second one is refused as "logged in from another location"; - one `servers.dat`. `horizon-client --player-dir DIR` puts one player's own files in DIR: - `options.txt` and the settings files beside it (`horizon-extras.txt`, `horizon-graphics.txt`, the controller's); - `logs/` and `crash-reports/` (main.rs reads the option before the log opens, as it does `--home`); - `horizon-player.txt`, `servers.dat`, `hotbar.nbt` and `screenshots/`. What the game folder's players share stays in the game folder: saves, resource and shader packs, and mods. That includes the enabled-mods list (`logging::shared_dir`) and native mods' `config/`, which so far followed `options.txt`'s folder and now follow the game folder (`Game::game_dir`). Without the option nothing moves: `player_dir()` is the working directory, where `options.txt` already was. The Launch API lists the option. 0.1.0 isn't released yet, so it joins 0.1.0's list (docs/api/launch.md, the regenerated reference) rather than making a 0.1.1. Main is merged in: its narrator start sits beside the settings, which now load from `Game::options_path()`. The launcher will pass it only to versions whose `--launch-api` reply lists it. That change is ready on [`Solenopsisbot:accounts/launcher-player-dir`](https://github.com/Solenopsisbot/horizon/compare/accounts/concurrent...accounts/launcher-player-dir), on top of #5023. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [x] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference None: vanilla's `--gameDir` has no per-player part. Horizon-only, and nothing changes without the option. ## Self-check **pr_ready** (`tools/pr_ready.py` on cytonic, against origin/main at 9d979caa4, 35 min 9 s) | Check | Result | | --- | --- | | Scope | ✅ 14 files, +107 −37 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 495 passed (43 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (1 min 22 s) | | tests: horizon-client, horizon-client-render | ✅ 2040 passed (4 min 45 s) | | doc tests | ✅ 0 passed (3 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 | ✅ 113 affected, 112 passed (27 min 58 s) | By hand on Linux (Vulkan, GTX 970, `--offscreen`): - Two games started at once in one folder with `--player-dir players/Alice` and `players/Bob` each logged to its own `players/<name>/logs/latest.log`; neither fell back to the terminal. Both saved their worlds in the shared `saves/`. - A third, without `--name`, kept `options.txt` (after `horizon-ctl options-set renderDistance 6`), `horizon-graphics.txt` and its generated `horizon-player.txt` in `players/Carol/`, and nothing per-player in the game folder. 🤖 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:19 +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#6329
No description provided.