Skip to content

Cloud save support#224

Merged
Sude- merged 12 commits into
Sude-:masterfrom
loki-47-6F-64:cloud-save
Oct 1, 2022
Merged

Cloud save support#224
Sude- merged 12 commits into
Sude-:masterfrom
loki-47-6F-64:cloud-save

Conversation

@loki-47-6F-64
Copy link
Copy Markdown
Contributor

With this PR I'm adding cloud save support for GOG. It allows you to download, upload and delete cloud saves.

Command line options

  • --galaxy-show-cloud-saves product_id/build_index -> Show remote cloud saves
  • --galaxy-show-local-cloud-saves product_id/build_index -> Show cloud saves locally stored
  • --galaxy-download-cloud-saves product_id/build_index -> Download cloud saves
  • --galaxy-upload-cloud-saves product_id/build_index -> Upload cloud saves
  • --galaxy-delete-cloud-saves product_id/build_index -> Delete cloud saves
  • --cloud-whitelist path1 path2 path3... -> Only include these files
  • --cloud-blacklist path1 path2 path3... -> Exclude these files
  • --cloud-force -> Depending on --galaxy command -> Force download/upload cloud saves even if they're up-to-date, Delete cloud saves even if no saves have been explicitly whitelisted

Highlighted changes/additions to the code
When downloading or uploading, the relevant files are put in a queue, which will be processed in processCloudSaveDownloadQueue and processCloudSaveUploadQueue respectively

For deletion, a simple DELETE request per file you wish to delete is sufficient.

The following variables have been added to the global config

        // Cloud save options
        std::vector<std::string> cloudWhiteList;
        std::vector<std::string> cloudBlackList;
        bool bCloudForce;

Let me know what you think of it :)

@imLinguin
Copy link
Copy Markdown

imLinguin commented Aug 7, 2022

I'm not sure if it's handled properly, but I wanted to let you know some games may have multiple save locations specified.
For example
game clientid: 49903594087328394)

{
"enabled": true,
"locations": [
  {
    "name": "saves",
    "location": "<?DOCUMENTS?>\/S2\/saves"
  },
  {
    "name": "mp_saves",
    "location": "<?DOCUMENTS?>\/S2\/mp_saves"
  }
]
}

Or none at all

{
"enabled": true,
"locations": [ ],
}

in that case path should fall back to __default as name, and locations are

  • %LocalAppData%\GOG.com\Galaxy\Applications\%ClientID%\Storage on Windows

  • ~/Library/Application Support/GOG.com/Galaxy/Applications/%ClientID%/Storage on macOS.

I did this research for Heroic Games Launcher purposes I hope it will be helpful.

@loki-47-6F-64
Copy link
Copy Markdown
Contributor Author

loki-47-6F-64 commented Aug 8, 2022

{
"enabled": true,
"locations": [ ],
}

in that case path should fall back to __default as name, and locations are

  • %LocalAppData%\GOG.com\Galaxy\Applications\%ClientID%\Storage on Windows
  • ~/Library/Application Support/GOG.com/Galaxy/Applications/%ClientID%/Storage on macOS.

I did this research for Heroic Games Launcher purposes I hope it will be helpful.

Thanks, I've added this to the PR.

I've noticed a bug introduced in this PR that could prevent refreshing the auth token. This should be fixed before merging.

@Sude-
Copy link
Copy Markdown
Owner

Sude- commented Sep 30, 2022

Thanks for the pull request.
I took a quick look at the code and everything looks good.
I'll take a closer look at this during the weekend and merge if I don't find anything that needs fixing.

@Sude- Sude- merged commit 6ae6ab2 into Sude-:master Oct 1, 2022
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.

3 participants