Stores: GOG and Epic cloud saves

Ported from Bannerlator's cloud-save managers. Before every launch the
cloud copy comes down where it is newer: droiddeck-store-launch asks the
app and waits up to 15 s. For a store game with cloud saves it tells the
compat tool so, and the tool waits for Proton instead of exec'ing it,
then asks for the upload without waiting. Newest wins per file, with an
MD5 check so a file the game only touched is not sent again; a download
first copies the folder to the app's storage (last three kept).

The save folder is GOG's remote-config location template (by the game's
Galaxy client id) or Epic's CloudSaveFolder catalog attribute, expanded
inside the game's Proton prefix or install folder by CloudSavePaths,
which refuses a path that leaves its boundary. GOG uploads with a token
issued to the game's own client (its secret is kept at install from now
on), Epic with signed write links. The GOG and Epic cards get a Cloud
saves switch kept in the sidecar; Manage saves shows the last sync with
Upload and Download, or No cloud saves.
This commit is contained in:
The412Banner committed 2026-10-09 05:39:40 -04:00
1 parent 935b70c585
commit 1580e3ee64
17 files changed
+853 -41

No files matched your search

+25
View File
@@ -115,6 +115,31 @@ in droiddeck-env adds `WINEDEBUG=+shell,+winebrowser`. Epic's EOS overlay is not
it games exited while loading); an `OverlayPath` an earlier build wrote is removed at launch. The
parked overlay work is on the branch `park/epic-eos-overlay`.
## Cloud saves
GOG and Epic games sync their saves with the store's cloud (`CloudSaves`, after Bannerlator's
managers): before a launch the cloud copy comes down where it is newer, after the game exits what
changed goes up - newest wins, file by file, with an MD5 check so a file the game only touched is
not sent again. Before a download overwrites anything the folder is copied to
`files/stores/cloud-backups/<store>-<id>/` (the last three kept).
- **The folder:** GOG's public remote-config gives a location template per game (by its Galaxy client
id), e.g. `<?APPLICATION_DATA_LOCAL_LOW?>/Hyperstrange/ELDERBORN`; Epic's catalog gives
`CloudSaveFolder`, e.g. `{AppData}/Game/Saved/SaveGames`. `CloudSavePaths` expands it inside the
game's prefix (`compatdata/<shortcut appid>/pfx/drive_c/users/steamuser`) or its install folder,
case-insensitively, and refuses a path that leaves its boundary. A game whose store gives none
has no cloud saves.
- **The services:** GOG `cloudstorage.gog.com/v1/<user>/<client>` with a token issued to the game's
own client (the client secret is kept at install; the Galaxy token is the fallback); Epic's
savesync data storage with signed read and write links.
- **When:** every launch runs `droiddeck-store-launch`, which asks the app (`cloud-down`) and waits up
to 15 s; for a store game with cloud saves it returns 10, and the compat tool then waits for
Proton instead of exec'ing it and runs `droiddeck-store-launch --exited` after, which asks for
`cloud-up` without waiting. Each sync logs `cloud <store> <id> down|up files= bytes= result=`.
- **Per game:** the store card in the Games tab's launch settings has "Cloud saves" (on), kept in the
sidecar (`"cloud"`) and read by both sides; Manage saves shows the last sync with Upload and
Download, or "No cloud saves".
## Downloads
`DownloadQueue` runs 1–3 jobs at a time (Setup / the Downloads page), each a store's whole install
+8
View File
@@ -144,6 +144,14 @@ without it and Setup says "Stores engine not built").
(`token`, `__token__`, `f_token`, `hdnts`, access/refresh/id tokens, `code=`) and Authorization /
Cookie headers are blanked outside URLs too. `StoreLogTest` covers a GOG secure link and an Epic
Akamai URL. The engine's own logcat lines (tag `EpicNative` etc.) are written on the native side.
- **GOG and Epic cloud saves** (ported from Bannerlator's managers, device-proven there in August):
down before every launch where the cloud copy is newer (the compat tool waits up to 15 s), up
after the game exits (the compat tool waits for Proton for such a game, then asks without
waiting), newest wins per file with an MD5 check, a backup of what a download overwrites (last
three). The save folder comes from GOG's remote-config template or Epic's CloudSaveFolder,
expanded inside the game's prefix (`CloudSavePaths`, Bannerlator's cases as tests). A "Cloud
saves" switch on the GOG / Epic card, and cloud rows in Manage saves (last sync, Upload,
Download, "No cloud saves"). Not yet device-tested.
- **Epic sign-in device-proven without the overlay (AYANEO Pocket FIT, `bf81104`, Metalstorm):** EOS's
corrective-action browser flow → `droiddeck xdg-open: https://www.epicgames.com` → Chrome
`epicgames.com/id/authorize?user_code=…` → approved → `[eos] got logged in`, product user id