Localhost TCP/IP Server for Modding

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
CPSuperstore
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon May 23, 2022 5:15 pm
Contact:

Localhost TCP/IP Server for Modding

Post by CPSuperstore »

Hi all

I was wondering if a TCP/IP connection could be added to modding capability. I understand the potential security risks this poses, so to combat those, I would suggest the TCP/IP can only act as a server which accepts TCP/IP connections from Localhost only. This is the same way OpenRCT2 allows access to a TCP/IP connection.

With this configuration, the end user would need to download and run additional software provided by the mod creator at the discretion of end user. The mod itself would not be able to dispatch any TCP requests, only receive them and only to localhost, so nothing shifty could occur.

Additionally, mods which use this functionality could have to disclose TCP is being used, and the mod page can display a warning to the user indicating a potentially unsafe mod.

The use case of this would be for a system I am working on which allows people to mess with your game as you play it (example, the audience presses a button and 100 spitters are sent to your factory). I have integrated Minecraft and OpenRCT2 so far, and I really want to extend functionality to Factorio, and without this modding feature I sadly can not figure out how to do this.

Thank you for your time and consideration.

Xorimuth
Filter Inserter
Filter Inserter
Posts: 623
Joined: Sat Mar 02, 2019 9:39 pm
Contact:

Re: Localhost TCP/IP Server for Modding

Post by Xorimuth »

Such mods already exist using the RCON API for sending data into the game and write_file for getting it out (see clusterio as well).
My mods
Content: Freight Forwarding | Spidertron Patrols | Spidertron Enhancements | Power Overload
QoL: Factory Search | Remote Configuration | Module Inserter Simplified | Wire Shortcuts X | Ghost Warnings

CPSuperstore
Manual Inserter
Manual Inserter
Posts: 2
Joined: Mon May 23, 2022 5:15 pm
Contact:

Re: Localhost TCP/IP Server for Modding

Post by CPSuperstore »

I must have missed that one in the documentation. Thanks for your help!

For anyone else who is searching, the here are the docs:
https://lua-api.factorio.com/latest/LuaRCON.html

And a Python library I found which handles sending commands:
https://github.com/mark9064/factorio-rcon-py

Post Reply

Return to “Modding interface requests”