Rest API support in GameScript

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Post Reply
santtd
Engineer
Engineer
Posts: 2
Joined: 26 Apr 2025 17:43

Rest API support in GameScript

Post 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
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 991
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: Rest API support in GameScript

Post 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.
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 23 guests