Skip to content

Commit

Permalink
improv: refactor structure, add files generator
Browse files Browse the repository at this point in the history
  • Loading branch information
imLinguin committed Apr 1, 2023
1 parent a1a449b commit 840ad43
Show file tree
Hide file tree
Showing 8 changed files with 369 additions and 31 deletions.
117 changes: 117 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ reqwest = { version = "0.11", features = ["json"] }
tokio = { version = "1", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
regex = "1"
regex = "1"
sqlite = "0.30.4"
flate2 = "1.0"
indicatif = { version = "0.17.3", features = ["tokio"] }
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ 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 automatically generated `ClientId.json` files for each game. That are disabled by default. Contributions to that directory are welcome. All json files are formatted using Prettier.

### Obtaining the relevant game data

Expand All @@ -30,7 +30,7 @@ Let's say, you want to add a new linux native game to suport cloud saves.
4. Copy client id
5. Make a [request to the API](#api) with it
6. Find corresponding paths on Linux
7. Write config file
7. Write/Update config file

### Sample config

Expand All @@ -43,7 +43,7 @@ Let's say, you want to add a new linux native game to suport cloud saves.
{
"name": "saves",
"location": "<?XDG_CONFIG_HOME?>/unity3d/Team Cherry/Hollow Knight",
"wildcard": "*.dat" // This can be null
"wildcard": "*.dat"
}
]
}
Expand All @@ -58,7 +58,7 @@ Let's say, you want to add a new linux native game to suport cloud saves.

- 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)
- 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 on Linux)

**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)
Expand All @@ -78,3 +78,15 @@ APPLICATION_DATA_ROAMING
APPLICATION_SUPPORT
DOCUMENTS
```

## Running the server

```
cargo run --bin gog_proxy
```

## Generate json files

```
cargo run --bin generator
```
Loading

0 comments on commit 840ad43

Please sign in to comment.