Page 1 of 1
Rest API support in GameScript
Posted: 27 Apr 2025 09:24
by santtd
Is there any issue in adding some web client in the squirrel language for gamescripts?
Maybe i tcould be a security issue? but it could open a lot new scenarios and integrations
Re: Rest API support in GameScript
Posted: 01 May 2025 13:37
by frosch
Scripts won't be allowed to initiate extern comunication on their own.
However, you can talk to GameScripts via the AdminPort.
* Sending: GSAdmin.Send
https://docs.openttd.org/gs-api/classGSAdmin
* Receiving: GSEventAdminPort
https://docs.openttd.org/gs-api/classGSEventAdminPort
So, if you have a custom server, you can run a bridge outside of OpenTTD to provide GameScripts with additional services through the AdminPort.
None of this will ever be available for clients or average-joe players.