fix(recomplauncher): saves are the save folders, not Longshot's whole data folder #2364

Merged
HumanBean merged 1 commit from Xarishark/Longshot:fix/recomplauncher-save-folders into main 2026-11-23 16:45:40 +00:00
Contributor

RecompLauncher backs up and cloud-syncs Longshot's whole data folder instead of its saves: the builder, the launcher,
NVIDIA's DLSS files and the save backups go into every save copy, and a cloud save sends them off the PC.

Hookshot gets the same fix, with its names, in Hookshot#3164.

What changes

  • Before: saves named {local}/longshot and {install}/Longshot/user. {local}/longshot is
    $XDG_DATA_HOME/longshot on Linux and %LOCALAPPDATA%\Longshot on Windows, which also hold the builder, the
    launcher, NVIDIA's DLSS files, the NFC tags and the save backups (and shaders on Windows). The Saves button opened
    %LOCALAPPDATA%\Longshot on Windows until the game folder had a user folder.

  • After: the folders the game writes when RecompLauncher's Play starts it (LongshotBuilder.exe --play /
    longshot-launch, no --user): <user>/save (host/nn_fs.c; <user>/save-work holds a save only while it is
    written, and goes into save at Commit) and <user>/mouse_sens.txt (host/nn_hid.c), <user> being
    {install}/Longshot/user on Windows and {local}/longshot on Linux (host/hos_main.c):

    "saves": ["{install}/Longshot/user/save", "{install}/Longshot/user/mouse_sens.txt",
              "{local}/longshot/save", "{local}/longshot/mouse_sens.txt"]
    

    The Saves button opens whichever save folder exists, else the game folder.

  • Copies made before this still restore where they came from. RecompLauncher maps an old copy onto a moved list by
    position only when the list keeps its length, and that would put <user>/save/<id> into <user>/save/save/<id>;
    with four entries instead of two, each old copy goes back into the folder it was made from.

Testing

Tested:

  • tests/test_recomplauncher_json.py: 13 pass (10 on main). New checks: the save list, tied to the lines in
    host/nn_fs.c, host/hos_main.c and host/nn_hid.c that make those folders; the list's length; and the Saves
    button's folders.
  • The file validates against https://recomplauncher.com/schema/recomplauncher.json with no errors.
  • RecompLauncher's own code (its main at 0.90 Beta 68, Windows 11, in a throwaway test that is not part of either
    repo), with this file:
    • The developer check (the Developer tab's): no errors, no unknown keys, no keeps_copy warnings; its warnings are
      the save and settings files not being there before the first Play, and the Linux save folder being outside
      {install}/{data}. The setup line with and without the copy is as before this change.
    • Backups on a game folder laid out as the game leaves it (save, save-work, mouse_sens.txt, cache storage) beside
      a data folder with a builder version, DLSS files, an NFC tag and a save backup in it: the old list copied 12 files,
      the half-written save-work, builder, tag and backup included; this list copies the 5 save files. The same with
      the Linux layout.
    • A copy made with the old list, restored with this one into a folder that lost its save: the save is back at
      user/save/<id>, with no save/save. RecompLauncher does not map the old list onto this one by position (it
      would have onto a two-entry list).
    • The Saves button opens the game folder before the first save, then the save folder.

Still to test:

  • Windows and Linux through RecompLauncher 0.90 Beta 68: install, build, play and save, then check the game's Saves
    tab backup holds only save/ and mouse_sens.txt, and that restoring a backup made before this puts the save back.

Risks

  • Backups made before this keep the extra files they carried; restoring one writes them back where they were.
  • Only the json and its test change. A revert is enough.
RecompLauncher backs up and cloud-syncs Longshot's whole data folder instead of its saves: the builder, the launcher, NVIDIA's DLSS files and the save backups go into every save copy, and a cloud save sends them off the PC. Hookshot gets the same fix, with its names, in [Hookshot#3164](https://git.notrexed.dev/Hookshot/Hookshot/pulls/3164). ## What changes - Before: `saves` named `{local}/longshot` and `{install}/Longshot/user`. `{local}/longshot` is `$XDG_DATA_HOME/longshot` on Linux and `%LOCALAPPDATA%\Longshot` on Windows, which also hold the builder, the launcher, NVIDIA's DLSS files, the NFC tags and the save backups (and shaders on Windows). The Saves button opened `%LOCALAPPDATA%\Longshot` on Windows until the game folder had a `user` folder. - After: the folders the game writes when RecompLauncher's Play starts it (`LongshotBuilder.exe --play` / `longshot-launch`, no `--user`): `<user>/save` (host/nn_fs.c; `<user>/save-work` holds a save only while it is written, and goes into `save` at Commit) and `<user>/mouse_sens.txt` (host/nn_hid.c), `<user>` being `{install}/Longshot/user` on Windows and `{local}/longshot` on Linux (host/hos_main.c): ```json "saves": ["{install}/Longshot/user/save", "{install}/Longshot/user/mouse_sens.txt", "{local}/longshot/save", "{local}/longshot/mouse_sens.txt"] ``` The Saves button opens whichever save folder exists, else the game folder. - Copies made before this still restore where they came from. RecompLauncher maps an old copy onto a moved list by position only when the list keeps its length, and that would put `<user>/save/<id>` into `<user>/save/save/<id>`; with four entries instead of two, each old copy goes back into the folder it was made from. ## Testing **Tested:** - `tests/test_recomplauncher_json.py`: 13 pass (10 on `main`). New checks: the save list, tied to the lines in `host/nn_fs.c`, `host/hos_main.c` and `host/nn_hid.c` that make those folders; the list's length; and the Saves button's folders. - The file validates against https://recomplauncher.com/schema/recomplauncher.json with no errors. - RecompLauncher's own code (its main at 0.90 Beta 68, Windows 11, in a throwaway test that is not part of either repo), with this file: - The developer check (the Developer tab's): no errors, no unknown keys, no `keeps_copy` warnings; its warnings are the save and settings files not being there before the first Play, and the Linux save folder being outside `{install}`/`{data}`. The setup line with and without the copy is as before this change. - Backups on a game folder laid out as the game leaves it (save, `save-work`, `mouse_sens.txt`, cache storage) beside a data folder with a builder version, DLSS files, an NFC tag and a save backup in it: the old list copied 12 files, the half-written `save-work`, builder, tag and backup included; this list copies the 5 save files. The same with the Linux layout. - A copy made with the old list, restored with this one into a folder that lost its save: the save is back at `user/save/<id>`, with no `save/save`. RecompLauncher does not map the old list onto this one by position (it would have onto a two-entry list). - The Saves button opens the game folder before the first save, then the save folder. **Still to test:** - Windows and Linux through RecompLauncher 0.90 Beta 68: install, build, play and save, then check the game's Saves tab backup holds only `save/` and `mouse_sens.txt`, and that restoring a backup made before this puts the save back. ## Risks - Backups made before this keep the extra files they carried; restoring one writes them back where they were. - Only the json and its test change. A revert is enough.
fix(recomplauncher): saves are the save folders, not Longshot's whole data folder
Some checks failed
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Failing after 4s
25d9957455
RecompLauncher's backups and cloud saves copy what saves names. It named {local}/longshot
and {install}/Longshot/user:

- {local}/longshot is %LOCALAPPDATA%\Longshot on Windows and $XDG_DATA_HOME/longshot on
  Linux. Besides the Linux saves it holds the builder, the launcher, NVIDIA's DLSS files, the
  NFC tags and the save backups, so every save copy carried them, and a cloud save sent them
  off the PC.
- The Saves button opened {local}/longshot on Windows whenever the game folder had no user
  folder yet.

Started by RecompLauncher's Play (the builder's --play, no --user), the game keeps its
saves in <user>/save (host/nn_fs.c; <user>/save-work only while one is written) and the
mouse sensitivity in <user>/mouse_sens.txt (host/nn_hid.c), <user> being the game folder's
user folder on Windows and $XDG_DATA_HOME/longshot on Linux (host/hos_main.c). saves now
names those, on both systems, and the Saves button opens whichever save folder there is,
else the game folder.

Copies made before this go back where they came from: the launcher maps an old copy onto a
moved list by position only when the list keeps its length, which would put <user>/save/<id>
into <user>/save/save/<id>. This list has four entries, not two.
Member

Possibly related, for context:

  • issue #2250 fs: a held or read-only save-work file makes MountSaveData refuse the save (probe) — Related save-work and cloud-sync interaction
Possibly related, for context: - issue #2250 fs: a held or read-only save-work file makes MountSaveData refuse the save (probe) — Related save-work and cloud-sync interaction
Xarishark changed title from WIP: fix(recomplauncher): saves are the save folders, not Longshot's whole data folder to fix(recomplauncher): saves are the save folders, not Longshot's whole data folder 2026-11-23 15:39:07 +00:00
HumanBean deleted branch fix/recomplauncher-save-folders 2026-11-23 16:45:41 +00:00
Some checks failed
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Failing after 4s
Some workflows are waiting to be reviewed.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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
MagicBeanDev/Longshot!2364
No description provided.