[PR #4203] [CLOSED] Splitscreen: use the launcher's other Microsoft accounts #5482

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4203
Author: @martipops
Created: 10/30/2026
Status: ❌ Closed

Base: main ← Head: split/16-launcher-accounts


📝 Commits (10+)

  • 2966033 Allow sound engines to share one dimension-aware audio output
  • b3e5cb2 Merge remote-tracking branch 'origin/split/02-audio' into split/06-two-players
  • ce0983f Merge remote-tracking branch 'origin/split/04-pointer-ownership' into split/06-two-players
  • 563d85f Merge remote-tracking branch 'origin/split/05-viewports' into split/06-two-players
  • 70a9fd6 Splitscreen: a second player in the same window (HORIZON_SPLIT=N)
  • 9b19ab5 Splitscreen: each controller drives its own player
  • c911e90 splitscreen_e2e: find horizon-ctl.exe on Windows
  • 408ca59 Merge branch 'split/06-two-players' into split/07-controllers
  • 557a675 splitscreen_e2e: replies through a file, so Windows doesn't hang on launch
  • bd6ead7 Merge branch 'split/06-two-players' into split/07-controllers

📊 Changes

52 files changed (+8846 additions, -135 deletions)

View changed files

📝 Cargo.lock (+3 -0)
📝 crates/horizon-client-render/src/audio.rs (+428 -31)
📝 crates/horizon-client-render/src/auth.rs (+52 -0)
📝 crates/horizon-client-render/src/extras.rs (+44 -5)
📝 crates/horizon-client-render/src/gfx.rs (+16 -7)
📝 crates/horizon-client-render/src/lib.rs (+3 -0)
📝 crates/horizon-client-render/src/options_ui.rs (+123 -3)
📝 crates/horizon-client-render/src/split_layout.rs (+487 -1)
➕ crates/horizon-client-render/src/split_map.rs (+166 -0)
➕ crates/horizon-client-render/src/split_profiles.rs (+655 -0)
➕ crates/horizon-client-render/src/split_profiles/store.rs (+90 -0)
➕ crates/horizon-client-render/src/split_ui.rs (+1496 -0)
📝 crates/horizon-client-render/src/widgets.rs (+19 -0)
📝 crates/horizon-client/Cargo.toml (+7 -0)
📝 crates/horizon-client/assets/horizon/lang/en_us.json (+5 -0)
📝 crates/horizon-client/build.rs (+9 -0)
📝 crates/horizon-client/src/game.rs (+45 -14)
📝 crates/horizon-client/src/game/agent.rs (+33 -2)
📝 crates/horizon-client/src/game/control.rs (+9 -0)
📝 crates/horizon-client/src/game/discord.rs (+4 -0)

...and 32 more files

📄 Description

🤖 Opened by martipops's AI agent (Codex), not by martipops themselves.

a

Blocked by: #4202 (splitscreen on servers), and through it #4201, #4180, #4165, #4164, #4163, #3825 and #3826.

What and why

Part of the splitscreen series (#3541), last: the launcher hands its other signed-in Microsoft
accounts to splitscreen players. Until #4202 merges, the diff below includes the earlier parts.
The earlier self-check below covers the original account handoff; the follow-up account-status validation is listed separately.

Why the launcher is involved: on an online-mode server (most public servers), every player
must sign in with their own Microsoft account, as on separate computers. An offline profile can
only play in P1's world, over LAN or on offline-mode servers (#4202 refuses it on online-mode ones
before it tries). So splitscreen needs each extra player to be able to use one of the launcher's
other signed-in accounts.

  • Launcher (account.rs, account_sessions): only while the game's Splitscreen setting is
    on (horizon-extras.txt). At Play, each other signed-in account's token is renewed when due
    with the existing check. Each gets a session file with the existing write_session_file (the
    same private, read-once file the playing account gets), and the files are listed in
    HORIZON_ACCOUNT_SESSIONS. An account that cannot supply a session is still listed by name, with no token, and the game starts all the same. session_for_game
    returns a GameSession (file, offline reason, env).
  • Game: reads those sessions at start, beside --session-file, while the files are fresh
    (split/launcher.rs). It offers them first on the profile page, marked "(Microsoft)". A player
    who picks one signs in as that account for its connections and skin (Game::auth). An expired
    sign-in is refused on the page with what to do (AuthSession::expired), and an account's
    profile can't be forgotten.
  • Account status: valid sessions retain “(Microsoft)” with a “Microsoft online” hover tooltip.
    Expired or unavailable sessions show “(Offline)” with “Sign in again in the launcher”. Names
    remain usable locally and cannot be forgotten as ordinary offline profiles. The existing
    online-server explanation is preserved; selecting an unavailable account there explains
    that the player must sign in again and restart. The game logs unavailable account names,
    without tokens or session-file contents.
  • Docs: docs/microsoft-account.md.

Built only on the launcher's current code. Nothing from #3496, and no other launcher's or
project's source.

Suggested label: feature.

Self-check

Follow-up account-status checks: nine profile-picker tests pass (including unavailable names
remaining selectable and protected from Forget); launcher library tests 279 pass, four ignored,
plus 52 binary tests and three integration tests. Workspace clippy (all targets), launcher
clippy (all targets), formatting, Python harness syntax, and public-tree checks pass. Live
launcher scenario passes: valid account joining, unavailable account marked Offline and
protected from Forget, and new offline profile persistence.

  • The launcher test splitscreen_gets_the_other_accounts_that_still_hold: a playing account
    plus a valid, an expired (cannot be renewed offline) and a non-owning one gives only the valid
    session file, while retaining metadata for unavailable accounts. Nothing with one account; only with the Splitscreen setting on.
  • AuthSession::expired: a token past its exp, or a minute away, counts as expired.
  • Live scenario launcher: an account session handed in the variable is listed first and
    marked; picking it joins; a new offline profile is kept in the instance.
  • Launcher: rustfmt, clippy and its 279 tests pass (macOS, gpui/runtime_shaders).
  • All 29 live scenarios pass on macOS at this branch (ee9742b52).

Linux (Fedora 44, GNOME on Wayland), at G (ee9742b52): alone, join, windows, setup, controls, live, leave,
pausemenu, pointer, gui_scales, profile_availability, server, packs, dedicated_profiles,
integrated_profiles and launcher all pass (the 8 GB laptop skips the 4-, 8- and 16-player ones).
Windows, at G: all 29 live scenarios pass (after the harness fix 8df9a585b: a larger window for
gui_scales and sixteen on a 100% display, portrait halves in monitor).
By hand on Windows (martipops, physical controllers, two monitors, one portrait), at G: "everything worked
great". Covered: picking P2 up (yellow arrows), LB/RB, A drop and Apply, B put back; Give Up Pad (timed out or
B: P1 keeps it; A: a new player joins with it); P2's Leave. The log has no errors.
By hand on Windows with martipops's two real Microsoft accounts (his OK), from the launcher built from this
branch: P2 picked the other account and joined P1's online-mode server as it ("joined the game", made an
operator). The first try skipped that account: its saved token was stale from an earlier test of another
branch, so the renewal failed and the launcher left it out, as designed. Signing it in again fixed it.

pr_ready (tools/pr_ready.py --quick --base upstream/main on Mac, against upstream/main at 6e0605ad3, 8 min 35 s)

Check Result
Scope ⚠️ 50 files, +8442 −127; 8501 lines of code: over 500, split it if it can ship in parts; mixes game, launcher
Cargo.lock ✅ changes with a Cargo.toml
Public tree ✅
Python tests ✅ 480 passed (23 s)
rustfmt ✅ (4 s)
clippy ✅ (57 s)
tests: workspace ✅ 2685 passed (4 min 51 s)
doc tests ✅ 0 passed (17 s)
content root tests ✅ 5 passed (1 min 13 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ✅ (1 s)
launcher clippy ✅ (32 s)
launcher tests ✅ 279 passed (17 s)
Parity ➖ 354 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 342 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Codex


🔄 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/4203 **Author:** [@martipops](https://github.com/martipops) **Created:** 10/30/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `split/16-launcher-accounts` --- ### 📝 Commits (10+) - [`2966033`](https://github.com/horizon-rust/horizon/commit/296603342f78d4f0fb691ee54af0442a7bd89f80) Allow sound engines to share one dimension-aware audio output - [`b3e5cb2`](https://github.com/horizon-rust/horizon/commit/b3e5cb2fa609cb87dd861dd37d1d9d748669dcdf) Merge remote-tracking branch 'origin/split/02-audio' into split/06-two-players - [`ce0983f`](https://github.com/horizon-rust/horizon/commit/ce0983fecc34035d440217ff3fc403001a446fa0) Merge remote-tracking branch 'origin/split/04-pointer-ownership' into split/06-two-players - [`563d85f`](https://github.com/horizon-rust/horizon/commit/563d85f95758086b66f3d046f0fe68412fccfeff) Merge remote-tracking branch 'origin/split/05-viewports' into split/06-two-players - [`70a9fd6`](https://github.com/horizon-rust/horizon/commit/70a9fd6f6a75d25d1c26dfaf26a9f4e26399ae8d) Splitscreen: a second player in the same window (HORIZON_SPLIT=N) - [`9b19ab5`](https://github.com/horizon-rust/horizon/commit/9b19ab5b04934069d9332b3073c3ba22c52eda9c) Splitscreen: each controller drives its own player - [`c911e90`](https://github.com/horizon-rust/horizon/commit/c911e9060de550927a854a3ec3f7995561c1f90a) splitscreen_e2e: find horizon-ctl.exe on Windows - [`408ca59`](https://github.com/horizon-rust/horizon/commit/408ca59a6540691bab3eb8adfaa85c104404ef68) Merge branch 'split/06-two-players' into split/07-controllers - [`557a675`](https://github.com/horizon-rust/horizon/commit/557a675d5dda830cd9e7506fd3e84ef1a31f50f6) splitscreen_e2e: replies through a file, so Windows doesn't hang on launch - [`bd6ead7`](https://github.com/horizon-rust/horizon/commit/bd6ead73c3bd43ddfe259d9762ab6f65e0b7d98a) Merge branch 'split/06-two-players' into split/07-controllers ### 📊 Changes **52 files changed** (+8846 additions, -135 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+3 -0) 📝 `crates/horizon-client-render/src/audio.rs` (+428 -31) 📝 `crates/horizon-client-render/src/auth.rs` (+52 -0) 📝 `crates/horizon-client-render/src/extras.rs` (+44 -5) 📝 `crates/horizon-client-render/src/gfx.rs` (+16 -7) 📝 `crates/horizon-client-render/src/lib.rs` (+3 -0) 📝 `crates/horizon-client-render/src/options_ui.rs` (+123 -3) 📝 `crates/horizon-client-render/src/split_layout.rs` (+487 -1) ➕ `crates/horizon-client-render/src/split_map.rs` (+166 -0) ➕ `crates/horizon-client-render/src/split_profiles.rs` (+655 -0) ➕ `crates/horizon-client-render/src/split_profiles/store.rs` (+90 -0) ➕ `crates/horizon-client-render/src/split_ui.rs` (+1496 -0) 📝 `crates/horizon-client-render/src/widgets.rs` (+19 -0) 📝 `crates/horizon-client/Cargo.toml` (+7 -0) 📝 `crates/horizon-client/assets/horizon/lang/en_us.json` (+5 -0) 📝 `crates/horizon-client/build.rs` (+9 -0) 📝 `crates/horizon-client/src/game.rs` (+45 -14) 📝 `crates/horizon-client/src/game/agent.rs` (+33 -2) 📝 `crates/horizon-client/src/game/control.rs` (+9 -0) 📝 `crates/horizon-client/src/game/discord.rs` (+4 -0) _...and 32 more files_ </details> ### 📄 Description > 🤖 Opened by martipops's AI agent (Codex), not by martipops themselves. a **Blocked by:** #4202 (splitscreen on servers), and through it #4201, #4180, #4165, #4164, #4163, #3825 and #3826. ## What and why Part of the splitscreen series (#3541), last: the launcher hands its other signed-in Microsoft accounts to splitscreen players. Until #4202 merges, the diff below includes the earlier parts. The earlier self-check below covers the original account handoff; the follow-up account-status validation is listed separately. **Why the launcher is involved:** on an online-mode server (most public servers), every player must sign in with their own Microsoft account, as on separate computers. An offline profile can only play in P1's world, over LAN or on offline-mode servers (#4202 refuses it on online-mode ones before it tries). So splitscreen needs each extra player to be able to use one of the launcher's other signed-in accounts. - **Launcher** (`account.rs`, `account_sessions`): only while the game's Splitscreen setting is on (`horizon-extras.txt`). At Play, each other signed-in account's token is renewed when due with the existing `check`. Each gets a session file with the existing `write_session_file` (the same private, read-once file the playing account gets), and the files are listed in `HORIZON_ACCOUNT_SESSIONS`. An account that cannot supply a session is still listed by name, with no token, and the game starts all the same. `session_for_game` returns a `GameSession` (file, offline reason, env). - **Game:** reads those sessions at start, beside `--session-file`, while the files are fresh (`split/launcher.rs`). It offers them first on the profile page, marked "(Microsoft)". A player who picks one signs in as that account for its connections and skin (`Game::auth`). An expired sign-in is refused on the page with what to do (`AuthSession::expired`), and an account's profile can't be forgotten. - Account status: valid sessions retain “(Microsoft)” with a “Microsoft online” hover tooltip. Expired or unavailable sessions show “(Offline)” with “Sign in again in the launcher”. Names remain usable locally and cannot be forgotten as ordinary offline profiles. The existing online-server explanation is preserved; selecting an unavailable account there explains that the player must sign in again and restart. The game logs unavailable account names, without tokens or session-file contents. - Docs: `docs/microsoft-account.md`. Built only on the launcher's current code. Nothing from #3496, and no other launcher's or project's source. Suggested label: `feature`. ## Self-check Follow-up account-status checks: nine profile-picker tests pass (including unavailable names remaining selectable and protected from Forget); launcher library tests 279 pass, four ignored, plus 52 binary tests and three integration tests. Workspace clippy (all targets), launcher clippy (all targets), formatting, Python harness syntax, and public-tree checks pass. Live `launcher` scenario passes: valid account joining, unavailable account marked Offline and protected from Forget, and new offline profile persistence. - The launcher test `splitscreen_gets_the_other_accounts_that_still_hold`: a playing account plus a valid, an expired (cannot be renewed offline) and a non-owning one gives only the valid session file, while retaining metadata for unavailable accounts. Nothing with one account; only with the Splitscreen setting on. - `AuthSession::expired`: a token past its `exp`, or a minute away, counts as expired. - Live scenario `launcher`: an account session handed in the variable is listed first and marked; picking it joins; a new offline profile is kept in the instance. - Launcher: rustfmt, clippy and its 279 tests pass (macOS, `gpui/runtime_shaders`). - All 29 live scenarios pass on macOS at this branch (ee9742b52). Linux (Fedora 44, GNOME on Wayland), at G (ee9742b52): `alone`, `join`, `windows`, `setup`, `controls`, `live`, `leave`, `pausemenu`, `pointer`, `gui_scales`, `profile_availability`, `server`, `packs`, `dedicated_profiles`, `integrated_profiles` and `launcher` all pass (the 8 GB laptop skips the 4-, 8- and 16-player ones). Windows, at G: all 29 live scenarios pass (after the harness fix 8df9a585b: a larger window for `gui_scales` and `sixteen` on a 100% display, portrait halves in `monitor`). By hand on Windows (martipops, physical controllers, two monitors, one portrait), at G: "everything worked great". Covered: picking P2 up (yellow arrows), LB/RB, A drop and Apply, B put back; Give Up Pad (timed out or B: P1 keeps it; A: a new player joins with it); P2's Leave. The log has no errors. By hand on Windows with martipops's two real Microsoft accounts (his OK), from the launcher built from this branch: P2 picked the other account and joined P1's online-mode server as it ("joined the game", made an operator). The first try skipped that account: its saved token was stale from an earlier test of another branch, so the renewal failed and the launcher left it out, as designed. Signing it in again fixed it. **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on Mac, against upstream/main at 6e0605ad3, 8 min 35 s) | Check | Result | | --- | --- | | Scope | ⚠️ 50 files, +8442 −127; 8501 lines of code: over 500, split it if it can ship in parts; mixes game, launcher | | Cargo.lock | ✅ changes with a Cargo.toml | | Public tree | ✅ | | Python tests | ✅ 480 passed (23 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (57 s) | | tests: workspace | ✅ 2685 passed (4 min 51 s) | | doc tests | ✅ 0 passed (17 s) | | content root tests | ✅ 5 passed (1 min 13 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ✅ (1 s) | | launcher clippy | ✅ (32 s) | | launcher tests | ✅ 279 passed (17 s) | | Parity | ➖ 354 affected, to run in CI (--quick): active_effect_tick, active_effects, ambient_sound, anchor, arrow, attribute_health, attribute_map_queries, attribute, attribute_updates, audio_attributes, auto_jump, bamboo and 342 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Codex](https://openai.com/codex/) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:12:54 +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#5482
No description provided.