Compatible OpenTTD versions: stable >=1.3.3 and nightly >=25810
Using this GS as a bridge you can:
- Call API methods
- Make use of enum constants in the API (so that you don't need to hard code their integer values in your client)
- Literal arguments can also be used (integer and strings)
- Create eg. GSTownList() and get a JSON array back with all town IDs
- Via special parameter specify if GSCompanyMode and/or GSTestMode should be active in scope when calling the API method
- Receive a message with the event when users answer the question dialog opened with GSGoal.Question
- Call SuperLib.Story.* methods (4 at the moment)
- Pass callback methods to APIs that accept that (mainly valuators)
- Use GSList APIs that require that you first create a list instance and then call member functions of the list instance.
- Use GSAccountingMode (would be easy to add, but I don't see any use case for it)
- No generic support for *all* events yet
The only method in the API classes that I haven't included is GSController.import as it is a hidden method not available for scripts to use. It may be that some of the methods included may not be useful or good to use. You can even use GSAdmin.Send to send messages, only problem is that currently tables are not listed as accepted argument types (which would be a quite simple change to allow if you may need it).
For further information, I suggest that you read the readme.txt file which contains quite a bit of information on how to format requests to ServerGS and what response messages that you can expect.
The script is GPLv2, but I would be happy if you contribute back patches if you make improvements to the script even if you don't share the script.
Edit:
- Link to readme.txt
- Repository can be found here: http://dev.openttdcoop.org/projects/gs- ... repository
- Version 2 also supports stable (1.3.3+)