@@ -36,20 +36,31 @@ Communication between an integration and the client is also possible with the us
3636import sys
3737from galaxy.api.plugin import Plugin, create_and_run_plugin
3838from galaxy.api.consts import Platform
39+ from galaxy.api.types import Authentication, Game, LicenseInfo, LicenseType
40+
3941
4042class 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
5465def 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
0 commit comments