Skip to content

Commit 9745dcd

Browse files
committed
GPI-1237 Docs clarification about platforms
1 parent ad758b0 commit 9745dcd

3 files changed

Lines changed: 33 additions & 10 deletions

File tree

PLATFORM_IDs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Platform ID list for GOG Galaxy 2.0 Integrations
44

55
| ID | Name |
66
| --- | --- |
7+
| test | Testing purposes |
78
| steam | Steam |
89
| psn | PlayStation Network |
910
| xboxone | Xbox Live |
10-
| generic | Manually added games |
1111
| origin | Origin |
1212
| uplay | Uplay |
1313
| battlenet | Battle.net |

README.md

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,31 @@ Communication between an integration and the client is also possible with the us
3636
import sys
3737
from galaxy.api.plugin import Plugin, create_and_run_plugin
3838
from galaxy.api.consts import Platform
39+
from galaxy.api.types import Authentication, Game, LicenseInfo, LicenseType
40+
3941

4042
class PluginExample(Plugin):
4143
def __init__(self, reader, writer, token):
4244
super().__init__(
43-
Platform.Generic, # Choose platform from available list
44-
"0.1", # Version
45+
Platform.Test, # choose platform from available list
46+
"0.1", # version
4547
reader,
4648
writer,
4749
token
4850
)
4951

5052
# implement methods
53+
54+
# required
5155
async def authenticate(self, stored_credentials=None):
52-
pass
56+
return Authentication('test_user_id', 'Test User Name')
57+
58+
# required
59+
async def get_owned_games(self):
60+
return [
61+
Game('test', 'The Test', None, LicenseInfo(LicenseType.SinglePurchase))
62+
]
63+
5364

5465
def main():
5566
create_and_run_plugin(PluginExample, sys.argv)
@@ -76,6 +87,20 @@ In order to be found by GOG Galaxy 2.0 an integration folder should be placed in
7687

7788
`~/Library/Application Support/GOG.com/Galaxy/plugins/installed`
7889

90+
### Logging
91+
<a href='https://docs.python.org/3.7/howto/logging.html'>Root logger</a> is already setup by GOG Galaxy to store rotated log files in:
92+
93+
- Windows:
94+
95+
`%programdata%\GOG.com\Galaxy\logs`
96+
97+
- macOS:
98+
99+
`/Users/Shared/GOG.com/Galaxy/Logs`
100+
101+
Plugin logs are kept in `plugin-<platform>-<guid>.log`.
102+
When debugging, inspecting the other side of communication in the `GalaxyClient.log` can be helpful as well.
103+
79104
### Manifest
80105

81106
<a name="deploy-manifest"></a>
@@ -84,8 +109,8 @@ Obligatory JSON file to be placed in an integration folder.
84109
```json
85110
{
86111
"name": "Example plugin",
87-
"platform": "generic",
88-
"guid": "UNIQUE-GUID",
112+
"platform": "test",
113+
"guid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
89114
"version": "0.1",
90115
"description": "Example plugin",
91116
"author": "Name",
@@ -97,9 +122,8 @@ Obligatory JSON file to be placed in an integration folder.
97122

98123
| property | description |
99124
|---------------|---|
100-
| `guid` | |
101-
| `description` | |
102-
| `url` | |
125+
| `guid` | custom Globally Unique Identifier |
126+
| `version` | the same string as `version` in `Plugin` constructor |
103127
| `script` | path of the entry point module, relative to the integration folder |
104128

105129
### Dependencies

src/galaxy/http.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
77
.. code-block:: python
88
9-
import logging
109
from galaxy.http import create_client_session, handle_exception
1110
1211
class BackendClient:

0 commit comments

Comments
 (0)