Send commands to server from outside the game

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
noschang
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Mar 20, 2018 2:26 am
Contact:

Send commands to server from outside the game

Post by noschang »

Hi everyone!

I want to do something and can't figure out how.
I know that you can issue commands from the in-game console.

However, what I want is to issue commands from outside the game.
I will explain.

I have a headless server running on the background (detached from the Linux terminal).
I want to be able to send commands to the server using the terminal or from a shell script.

Something like this:

/opt/factorio/bin/x64/factorio --send-command "/c game.player.force.manual_mining_speed_modifier=1000"

I've heard/read something about RCON.
But I don't know what RCON is and don't have any idea of how to use it.

Any help would be appreciated.
Thanks!

noschang
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Mar 20, 2018 2:26 am
Contact:

Re: Send commands to server from outside the game

Post by noschang »

Hi everyone!

I found out how to accomplish the desired behavior.
In linux, this is possible using a special "fifo" file.

You use the "mkfifo" tool to create a file that will be used as a bridge between the server process and the other processes.
No time to explain here with details, but basically after creating the file if you write on it, the content is redirected to the server process pipe.

Here is an service script for factorio that uses this strategy:
https://github.com/Bisa/factorio-init/b ... r/factorio

Anyway, thanks everybody.

Post Reply

Return to “Technical Help”