Coder Social home page Coder Social logo

tomhobson / sergen Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 2.0 2.04 MB

A discord chat bot and docker controller to create game servers easily.

License: MIT License

Dockerfile 0.91% C# 98.09% Shell 0.99%
docker chatbot game-server-hosting csharp discord-bot dotnetcore discord-chat minecraft factorio bot

sergen's Introduction

CodeScene Code Health .NET Build And Release License: MIT

Sergen

This discord bot will create servers that run out of the box.

Simply typing -run Minecraft will generate you a server on the latest version of minecraft with a world that is located within /opt/Sergen/serverfiles/{discordserverid}/Minecraft

All the supported images below will work with no issues. There are some work in progress game servers, but I haven't fully tested them so there's no guarantee they'll work.

Try it out here: https://discord.gg/aJpFaS2U

Animation of Sergen working

Supported Servers

  • Minecraft Java Edition
  • Minecraft Bedrock Edition
  • Factorio
  • Valheim
  • OpenTTD

If there's any servers you'd desperately like to see, feel free to open an issue.

Requirements

  • Windows/Linux (Not tested on a mac)
  • Docker
  • Dotnet 6.0 runtime

Installation

A systemd service is the recommended way to run Sergen. I create and run the service within the install scripts. If you don't want it setup this way, don't use the install scripts.

  • Download the latest build from the releases section. Extract it, then run ./Install.sh
  • Clone the git repo and run BuildAndInstall.sh

Setup

You'll need to setup a bot with discord, found here: https://discord.com/developers/applications

Here's an article on how to do it: https://www.howtogeek.com/364225/how-to-make-your-own-discord-bot/ (just do up before the Node.js part)

Get your token and update https://github.com/tomhobson/Sergen/blob/master/src/Sergen.Main/appsettings.json. Replace PUTBOTTOKENHERE with the token generated from https://discord.com/developers/applications.

You'll need to restart the service and invite your bot, which can be done with this link: https://discord.com/oauth2/authorize?client_id=123456789&scope=bot

Replace 123456789 with your bot's client id.

Allowlists

Sergen has allowlist implementation, for if you're running this on a big server and want to make sure only certain users can start and stop servers.

To enable this run: -allowlist enable

To add a user to the allowlist run: -allowlist add @discorduser

Only the server owner will be able to manage the allowlist.

Troubleshooting

Feel free to open an issue if you're having trouble setting this up, I'll be happy to help.

sergen's People

Contributors

dependabot[bot] avatar jamescoverdale avatar luisjones avatar tomhobson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

sergen's Issues

Default config for game server

With factorio the default config is to be public and force user authentication.

Sergen should allow a 'default' config file or even whole directory (whole dir would allow persistent game saves) to be used when creating a new game server.

Configurations for gamservers

We could have some multi-selection options for each game server.

Eg: Minecraft: Skyblock, Hardcore, Flatland and Vanilla
Terraria: Small, Medium, Large
Factorio: Railworld, biter world.

And so on.

Pre-configure some settings

Instead of just a json file we should have a directory with some pre setup configs.

This would also mean we need an extra parameter on the game server (take the default if no parameter is supplied)

We'll need to work out how to handle spaces in the server names etc

Eg minecraft -- creative flatland, survival, hardcore

Factorio -- railworld, normal

ksp -- sandbox, survival and career

Terraria won't run

This is due to not binding to the stdin and stdout. Will need to get this working in docker dotnet.

unsure if we should have a parameter on the game server json or if we just do it for all of them to keep the configs neat and uniform.

Move secrets out of projects

secrets in project = bad.

See if we can move to a different method for secrets. Should probably just add the appsetting.json and appsettings.development.json to be removed of secrets

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.