Skip to content

TrollyLoki/Discit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

163 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discit

Discord application for Satisfactory save files and dedicated server management

Overview

Discit is essentially a Discord-based alternative to the in-game server manager with a few additional features. It is fully compatible with any (non-experimental) dedicated server regardless of hosting provider or installed mods, relying only on the vanilla HTTPS and Lightweight Query APIs.

Highlights

  • Monitor live server status information from a single Discord channel
  • Receive automated alerts via Discord pings when a server goes down
  • Reload servers to update blueprints without requiring a forced restart
  • Upload save files to multiple servers simultaneously
  • Download saves from multiple servers into one consolidated zip file
  • Check save file info and validity
  • Change server names, options, and passwords
  • and much more

Features

Note: When the app is installed to a user, only the Save File Analysis feature is available.

Save File Analysis

The message context command feature (right click on a message -> Apps -> Discit -> Analyze save file(s)) can be used to extract header information from attached save files.

  • This information includes the timestamp, original save name, session name, playtime, mod list, and more
  • The app also checks if the save file's checksum is valid (i.e. it is a valid and unedited save)
  • If used on a message containing a zip file (such as those generated by /backup) the app will summarize the validity of each file within the zip
  • Note: The app currently uses Java's built-in zip file stream reader, which is rather primitive and might fail to read "fancier" external zip files, but will always be able to read its own zip files

Settings

The /settings command can be used to configure global app settings for a Discord server. Most settings can only be changed by members with the "Manager Server" permission.

  • An administrator role can be chosen to allow members without the "Manager Server" permission to use the below features
  • A save manager role can be chosen to allow members to download saves without allowing them to mess with the server
  • A dashboard channel can be chosen to display live server status information and shortcut action buttons
  • A log channel can be chosen to receive log messages when actions are performed
  • Automated alerts that mention a specified role if a server goes offline for a certain amount of time can be configured
    • These settings can be changed by anyone with the administrator role

Add Servers

The /add command can be used to add a server given a host name or IP address and port number.

  • Note: For security, the app will refuse to connect to the server if its fingerprint changes after this step
    • If needed, the server can be removed and re-added to update the fingerprint
  • If the newly added server is unclaimed, the app can claim it and automatically obtain authentication

Per-Server Settings

The /list command can be used to view server details, remove servers, or change per-server settings.

  • The delay before offline alerts are sent can be set for this specific server
  • A server channel can be chosen in which the reload, save, and upload commands automatically select the associated server
  • The /reload command can optionally be made available to everyone within a server's channel

Authentication

Authentication is required to access almost all server functions. The only exception is that the dashboard can still display game state information as long as no client password is set.

  • The app uses API tokens for authentication (the method recommended by the developers)
  • Authentication for a server can be managed using the /list command, but for initial authentication a shortcut button is also available on the dashboard
  • There are two methods available to provide authentication:
    1. An API token can be generated by running the server.GenerateAPIToken from the in-game server console and provided directly to the app
    2. The app can use the server's admin password to log in and automatically generate an API token (the password is not stored after the API token has been generated)

Dashboard

The dashboard channel displays live status information about all added servers and includes buttons for performing actions (if authenticated).

  • The "Reload Session" button creates a save on the server and then immediately loads that save
  • The "Download Save" button creates a save on the server and then downloads that save
  • The "Upload Save" button can be used to upload a save file to the server and (optionally) load it
  • The "New Session" button can be used to create a new game on the server
  • The "Creative Mode" button can be used to enable specific Creative Mode settings on the server's currently loaded session (due to API limitations, the app cannot disable any Creative Mode settings)
  • The "Rename Server" button can be used to rename the server
  • The "Server Options" button can be used to change the server's settings
  • The "Change Client Password" button can be used to change or remove the server's client password
  • The "Change Admin Password" button can be used to change the server's admin password
  • The "Invalidate Tokens" button invalidates all API tokens that have been generated by the server (this will also deauthenticate the app)

Slash Commands

Slash commands allow certain dashboard actions to be performed in other channels and for multiple servers at once.

  • The /reload command can be used to save and reload one or more servers' sessions at the same time
    • If any players are connected confirmation is requested before actually reloading the server(s)
  • The /save command can be used to create a save on a server and automatically attach it to the message in the channel where the command is used
  • The /upload command can be used to upload a save file to one or more servers simultaneously
    • Alternatively, the message context command feature (right click on a message -> Apps -> Discit -> Upload save file) can be used to upload a save file directly from a message attachment
  • The /backup command creates a save on each added server and automatically combines them into a zip file

Deployment

Environment Variables

  • BOT_TOKEN - Token from the Bot section of the Discord Developer Portal (required, the application will refuse to start if not set)
  • DATA_DIRECTORY - Path to the directory where settings and server info should be stored (defaults to "data" if not set)
  • ACCEPT_LOCAL_ADDRESSES - "true" to disable the address filter (Only set this variable if you need to test with a local server)
  • POLL_INTERVAL - Interval in milliseconds between Lightweight Query API poll requests (defaults to 500 milliseconds if not set)
  • OFFLINE_TIMEOUT - Delay in milliseconds before a server that has stopped responding is considered offline (defaults to 5 seconds if not set)
  • DEAD_TIMEOUT - Delay in milliseconds before a server that has stopped responding is considered dead (defaults to 60 seconds if not set)
  • DEAD_POLL_INTERVAL - Interval in milliseconds between poll requests to dead servers (defaults to 10 seconds if not set)

Data Storage

All persistent data is stored within the directory refered to by the DATA_DIRECTORY environment variable. It contains separate JSON files for each Discord server (guild) that the application has been added to.

Each file contains the global settings for the guild as well as the name, address, port, and fingerprint of each added server as well as the API tokens for them (if authenticated).

When running from within a container, a persistent volume or external directory must be mounted at /data (or the alternative path that DATA_DIRECTORY is set to) to ensure that the data persists across updates.

About

Discord application for Satisfactory save files and dedicated server management

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages