Skip to content

launcher: add co-op profiles (step 1 of #701) - #724

Draft
lenase0077 wants to merge 4 commits into
Dittobyte:mainfrom
lenase0077:feat/coop-profiles
Draft

lenase0077 wants to merge 4 commits into
Dittobyte:mainfrom
lenase0077:feat/coop-profiles

Conversation

@lenase0077

Copy link
Copy Markdown

What it changes

Implements build step 1 of #701 (Co-op profiles in the launcher):

  • Co-op profiles (profiles.rs, coop.rs): Profiles in profiles.json can now carry coop metadata (room_code, relay, members, world_version) while keeping their own save folder (<save_dir>/account/<uid_key>/). Existing profiles.json files without coop load unchanged as singleplayer profiles.
  • Launch-only environment (coop.rs, play.rs, launch.rs): Launching a co-op profile via play_coop passes its account identity (NXRT_ACCOUNT_UID, NXRT_ACCOUNT_NICKNAME, NXRT_NET_UID), relay network configuration (NXRT_NET_PROTOCOL=native, NXRT_NET_MODE=auto, NXRT_NET_INTERNET=true, NXRT_NET_RELAY, NXRT_NET_ROOM_CODE), and co-op flags (NXRT_PKP_COOP=1, NXRT_PKP_COOP_WORLD_VERSION, NXRT_PKP_LINK_INTERACT_EVERYWHERE=1, NXRT_PKP_LINK_STORY_COOP=0) in the child process environment for that launch only. profiles::apply_active leaves pkp.ini untouched for co-op profiles.
  • Mode launch separation (launch.rs, play.rs): Normal play and --play refuse co-op saves; play_coop refuses singleplayer saves (and refuses when pointing to 127.x while this PC's relay is off).
  • Copy between modes (saveimport.rs, profiles.rs, profile_cmds.rs): Adds saveimport::copy_account and commands for Start coop from my singleplayer save (profile_start_coop_from) and Copy to singleplayer (profile_copy_to_singleplayer), checking that a save exists and has no unfinished .commit.
  • Private room, members, and world version: Generates and normalizes 80-bit Crockford base32 room codes (XXXX-XXXX-XXXX-XXXX), validates optional custom relay IPv4 addresses (defaulting to 204.216.111.91:47610), records group members, and increments world_version after each co-op session (savebackup::Watch::start_for and online::Watch::start_for scope backups and online presence to the launched profile).
  • Launcher UI (home.js, action.js, settings-schema.js, settings/profiles.js, linkplay-coop.js, coop-model.js, i18n/*.js): Adds co-op profile creation and mode copying in Settings > Saves > Profiles, a Co-op section on Link Play for the private room code, relay, members, world version, and Play co-op, and Play co-op routing on Home, translated across all 9 languages.

Part of #701.

Pros

  • Co-op saves live in separate account folders and never touch singleplayer saves or pkp.ini.
  • Normal and co-op launches strictly enforce mode separation so neither save type is opened in the wrong mode.
  • Reuses profiles.json, saveimport::copy_account, savebackup, and online presence cleanly with minimal new surface area.
  • Existing profiles.json files and singleplayer workflows are unaffected.

Cons

  • Runtime support for reading NXRT_NET_ROOM_CODE under [net] protocol = native (runtime/src/services/ldn_native.cpp) and NXRT_PKP_COOP / NXRT_PKP_COOP_WORLD_VERSION (steps 2–4 of Seamless co-op and split screen: design draft #701) is not yet wired in the runtime, so co-op launches currently still use public relay listing until the runtime side lands.
  • Copying between modes does not yet rewrite the inner player UUID in CMNDAT.BIN / SYDAT.BIN (needed when two players on one group share the same origin save; handled in step 4 / Split screen: two to four players on one PC #692's swap_uuid).

For players

  • CHANGELOG.md ## Unreleased has an entry (Before / Now / Still not), or this change is not player-facing
  • Needs Set up again / Finish update: no (launcher-only change)
  • Rebuilds shaders: no

Rule overrides

  • AGENTS.md / PROJECT.md section 2 (Co-Authored-By trailer): Overridden at the collaborator's explicit instruction — commits on this branch omit the Co-Authored-By / AI attribution trailer.

…odel

Add co-op profile metadata (private Crockford room code, relay, members, world version) in profiles.json, keep co-op saves in their own account folder without writing to pkp.ini, and add copy between singleplayer and co-op modes via saveimport::copy_account.
…tion

Pass co-op account, relay, private room code, and co-op mode flags through the child process environment for that launch only, refuse normal launches of co-op saves and co-op launches of singleplayer saves, scope backups and online presence to the launched profile, and bump world_version after each co-op session.
Expose co-op profile creation, singleplayer/co-op save copying, private room code, relay, group members, world version, and Play co-op routing across Home, Settings > Saves, and Link Play, translated across all 9 languages.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant