Skip to content

Commit

Permalink
meta: improve documentation, add testing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
imLinguin committed Mar 31, 2023
1 parent 6f09c77 commit a1a449b
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Rust

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
69 changes: 68 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,73 @@ This project aims to close the gap between features offered for each platform. S

We hope GOG will eventually provide that data themselves, untill then we are on our own.

## API

Currently supported enpoint returns game config from `remote-config.gog.com` endpoint. If there is Linux data in games_data directory that will be extended

```
GET /api/config/client_id
```

## Contributing

The `games_data/` directory contains `ClientId.json` files for each game. Contributions to that directory are welcome. All json files are formatted using Prettier
The `games_data/` directory contains `ClientId.json` files for each game. Contributions to that directory are welcome. All json files are formatted using Prettier.

### Obtaining the relevant game data

Let's say, you want to add a new linux native game to suport cloud saves.

1. Go to https://gogdb.org
2. Find the game package you want to add
3. Pick a game build (eg. https://www.gogdb.org/product/1308320804/build/54853937123913458)
4. Copy client id
5. Make a [request to the API](#api) with it
6. Find corresponding paths on Linux
7. Write config file

### Sample config

```json
{
"overlay": { "supported": false },
"cloudStorage": {
"enabled": true,
"locations": [
{
"name": "saves",
"location": "<?XDG_CONFIG_HOME?>/unity3d/Team Cherry/Hollow Knight",
"wildcard": "*.dat" // This can be null
}
]
}
}
```

- overlay - not used currently, enabled should be set to false for now

- cloudStorage - enabled field indicates whether cloud saves are supported; locations is a array of objects containing name, location and wildcard

- name - location name - this should be set to same value as on Mac or Windows

- location - place where files are stored - this can use env vars like `$HOME`, values that have fallbacks (like `$XDG_CONFIG_HOME` falls back to `$HOME/.config`) should be closed in `<?SOME_VAR?>`

- wildcard - value can be set to `null`. Due to nature of some games on Linux that's required to not push unrelated junk to the cloud (that's usually a case for Unity games)

**IMPORTANT NOTE**
Some games can have enabled `cloudStorage` but empty locations array. This is caused by the fact that such games use `__default` location which is only available on Windows and Mac, since it's handled by Galaxy SDK (which doesn't exist on Linux btw). [SDK Documentation related to this](https://docs.gog.com/sdk-storage/#cloud-saves)

In that case config should still be defined if it's compatible, however the name should be set to `__default`

### Common location vars

Used on Windows and Mac

```
INSTALL
SAVED_GAMES
APPLICATION_DATA_LOCAL
APPLICATION_DATA_LOCAL_LOW
APPLICATION_DATA_ROAMING
APPLICATION_SUPPORT
DOCUMENTS
```

0 comments on commit a1a449b

Please sign in to comment.