Page 1 of 1

RCON in Single Player or when hosting a MP game from the GUI

Posted: Thu Sep 01, 2016 12:43 am
by justarandomgeek
I would like to be able to use RCON to allow other programs on my computer to inject lua commands into my game in single player, or with a multiplayer game started from the main menu, rather than with command line options (so that I only need one copy of the game running).

My specific use case is to use RCON to call Foreman's remote interface to add prints to the library, but there are obviously many uses for having RCON available in these modes.

Re: RCON in Single Player or when hosting a MP game from the GUI

Posted: Thu Sep 01, 2016 3:35 pm
by ssilk
I think to open this in general is a big security issue. :)

Re: RCON in Single Player or when hosting a MP game from the GUI

Posted: Thu Sep 01, 2016 5:59 pm
by justarandomgeek
ssilk wrote:I think to open this in general is a big security issue. :)
Presumably it would have some options that default to off, and one must turn it on if desired, just like how the headless RCON works.

Re: RCON in Single Player or when hosting a MP game from the GUI

Posted: Thu Sep 01, 2016 6:10 pm
by ssilk
Let's say it so: I dunno, how other games do it.

But from security aspect I would like to have an sshd in the game and if I connect via ssh (and some special port-number), I'm directly on the game-console. Input and output is 100% identical and I can turn it off in the game as long as I have been connected.

Something like so:

Code: Select all

ssilk@ssilkPro2 [~] > ssh ssilk@localhost:44140
password: *****************
Info: Logged in as player "ssilk" to FACTORIO 0.13.24 on "ssilkPro2", WORLD "test"
> /console off
Your ingame console is turned off now. It can be turned on with "/console on" or by logging out from this terminal.
>

Re: RCON in Single Player or when hosting a MP game from the GUI

Posted: Thu Sep 01, 2016 6:50 pm
by justarandomgeek
SSHd would be nice, but RCON is already there for non-GUI servers, and it seems simpler to extend/invoke what's already present than to integrate something new ;) Plus, it means any tools that use RCON for MP games would automatically work for relevant functions in SP games too, like my compiler-to-prints.

I'd be satisfied with any mechanism to push lua commands into a non-headless game though, as long as I can remote.call("foo","bar","baz") from outside I can make the rest work somehow!

Re: RCON in Single Player or when hosting a MP game from the GUI

Posted: Wed Oct 19, 2016 2:25 pm
by ssilk
Just because I chated today with LottieVixen in IRC today
sshd in Factorio would enable
- secure connections from anywhere in internet to your server (I think the so much better security is the most important aspect of this)
- forward our connection through firewalls
- using tools like screen/tmux
- connect by authorized keys is possible (no password needed, but still possible)
- open multiple connections (one for commandline, one for logs, one for ...) and multiple windows on multiple computers, cause you are not bound to Factorio.
- and many, many more really useful things


The negative side is:
- you need an ssh-client or
- implement of an ssh-client in Factorio itself
- configuring ssh (keys, config etc.) is for new users a hurdle
- afford for integration of ssh-lib etc. is unknown...

Sorry for tech-speak, but in my world this is daily business. :)

Re: RCON in Single Player or when hosting a MP game from the GUI

Posted: Wed Oct 19, 2016 2:57 pm
by justarandomgeek
Still seems like RCON would be an order or magnitude or two simpler, since it's already present in the game - it just needs to be loaded!

Also, many tools are already developing using RCON, including insanity such as Clusterio, which would be much easier to set up quickly if we had RCON from SP or non-headless MP servers.

Re: RCON in Single Player or when hosting a MP game from the GUI

Posted: Wed Nov 07, 2018 8:28 pm
by timboo07up
Although this topic is really old. I would still think this is a good feature to add for Single player and GUI MP games.

Since there are quite a lot of streamers for factorio, we could create a mod that performs certain actions in-game depending on chat/donations/other actions.
And setting up a separate server for that is usually a bit too much for most streamers/pc's.

I don't know if it's hard to enable the rcon in this way or that it poses problems. Like said before, disabled by default, but if its an option than it would be awesome!

RCON singleplayer ?

Posted: Mon May 06, 2019 8:23 am
by adamius
Hi

Can we get RCON enabled for singleplayer?

localhost-only connections is fine. Manually enabled in settings is also fine. Command line option to enable like the headless version etc.

thanks

Re: RCON in Single Player or when hosting a MP game from the GUI

Posted: Mon May 06, 2019 9:33 am
by Koub
[Koub] Merged into older topic with same request.

Re: RCON in Single Player or when hosting a MP game from the GUI

Posted: Tue Oct 27, 2020 7:37 am
by Kuxynator
Some time later...
Is a connection (RCon/SSH etc.) now available in single player mode?
Starting a server and a client on local host to play with only one player only to have a connection is unnecessary effort.
For security reasons this is the same risk as starting in SP with a connection available.

Re: RCON in Single Player or when hosting a MP game from the GUI

Posted: Tue Oct 27, 2020 7:49 am
by boskid
RCON in single player will not happen. There is no need to run headless + client to have RCON on localhost: in the config file there is `local-rcon-socket` and `local-rcon-password` (also available through the hidden settings: while in main menu hold Ctrl+Alt and press "Settings" then go to "The rest") - with this it is possible to run single instance that is hosting MP game with graphics for local player and with rcon enabled.