Coder Social home page Coder Social logo

ammmmmmmmmmmmmmmm / server_integration Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 23 KB

Read factorio mesage server log to activate Bash script to restart server on new map or go back a save. If an admin sends a specific message the server will respond within 10 seconds.

Python 86.38% Shell 13.62%
factorio-headless-server factorio factorio-server

server_integration's Introduction

GNU/Linux Factorio Command Integration

Run a server and send commands to the server from within the game chat feature!

How it Works

By chatting a command in a game chat such as:

[CHAT] Real_Laroy: ~reset

The Python script that runs when the game starts will check the log every 2 seconds to see if there is a command an admin sent in there!

Once it has figured out if the admin has sent a command it will then find out what command it is and run bash scripts to manage the server!

Commands

Type these commands in-game as a player in factorio!

#Stops factorio and python script
~stop
#Stops factorio, deletes saves, creates new map, starts
~reset
#Goes back to last autosave
~back
#Undo last ~back and go back to current (only saves one back)
~revert

Follow Along

Usefull Video but don't write his bash scripts such as stop.sh and run.sh, just import my improved ones.

Headless Setup

In the video he shows changing the names of alot of data files such as map-gen-settings.example.json into map-gen-settings.json. Do this as well because those are the names my scripts use.

I recommend setting this up after you already know bin/64/factorio is working and is on the port you want.

Steps to Use

Install the headless version of factorio on the website

Import all my files into your headless factorio folder

You will need to make make run.sh, stop.sh, and log_file_parser.py executable and own the entire server folder:

sudo chown (factorio server folder)
chmod +x ./log_file_parser
chmod +x ./stop.sh
chmod +x ./run.sh
chmod +x ./new_map.sh

In order to make yourself admin you will have to add your name to the server-adminlist.json file.

When factorio updates you will need to install headless server again just install it in the same folder and let it overwrite the files.

Intentions

This server manager is intended for final use in a EC2 image and I want to make it easy to install, right now it is not easy to install

License

MIT

server_integration's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.