Work in progress! This hasn't been tested thoroughly and a lot of things probably don't work.
R2Wraith is a batteries-included server management tool for the Northstar Titanfall2 mod. It provides:
- A declarative high-level interface to configure one or more servers.
- Process watching functionality to restart crashed servers.
- Functionality to reload config or restart R2Wraith while keeping servers running.
- An entirely commandline-based interface for dedicated headless servers.
This tool depends on pg9182's northstar-dedicated Docker image.
The latest builds are available on the Releases page. Build instructions are included at the bottom of this document.
Run R2Wraith from the command-line like this:
r2wraith.exe config.toml
Replacing config.toml
with the path to your configuration file - see the section below on the configuration format.
This will immediately start all servers. R2Wraith also provides its own commandline interface, with the following commands supported:
help
or?
- Display a list of available commands.version
- Display the version of R2Wraith.stopwraith
- Stop R2Wraith, keeping servers running and writing a restore file. This allows R2Wraith to attach to the current running servers the next time it's started. Use this to update R2Wraith seamlessly.stopall
- Shutdown all servers and stop R2Wraith. Warning: this terminates all servers, even with players connected.restartall
- Restart all servers. Warning: this terminates all servers, even with players connected.restart [name]
- Restart a server by name.reload
- Reload the configuration file, starting any added servers. Changes to existing servers will only apply when they are restarted. Servers that are removed in the config will not be stopped, usestopold
to stop them.stopold
- Stop any servers that have been removed from configuration.
R2Wraith reads a configuration file in the TOML format. For an example, check out the [example-config.toml] conf file in the repository.
Config file structure and defaults:
poll-seconds = 5 # how often to check each server's running state
auth-ports = { start = 8081, end = 8085 } # range of ports available to use for the Northstar auth server
game-ports = { start = 37015, end = 37020 } # range of ports available to use for the game server
[defaults]
# default settings for all servers, see Server properties below
docker-image = "northstar-dedicated" # name of docker image to run
game-dir = "/titanfall" # location of the game directory
[servers.my-first-server]
name = "My first server" # required - name shown in the in-game server list
auth-port = ? # optional - port to use for the Northstar auth server, picks from one of the auth-ports by default
game-port = ? # optional - port to use for the game server, picks from one of the game-ports by default
# see Server properties below for more options
[servers.my-second-server]
name = "My second server"
# ...
[servers.my-third-server]
# make as many as you want!
R2Wraith provides many properties you can configure for each server. It provides sane defaults for all properties,
you can override these by setting them under each server, or in the [defaults]
section of the config file to apply to
all servers.
- The name of a Docker image to start a container from each time the server is started.
- Example:
docker-image = "ghcr.io/pg9182/northstar-dedicated:1-tf2.0.11.0"
- A path to the game directory, relative to the config file.
- Example:
game-dir = "/data/titanfall"
- A description to show in the in-game server list. Sets the
ns_server_desc
convar. - Default:
"Your favourite R2Wraith server"
- Example:
description = "My fun server, contact me on Discord for help."
- Require a password to join the server. Keeping this empty means no password is required. Sets the
ns_server_password
convar. - Default:
""
- Example:
password = "Password123"
- Sets the tick rate for the server, i.e the rate that the server computes world updates. Sets the
base_tickinterval_mp
convar. - Default:
60
- Example:
tick-rate = 120
- Sets the desired update rate for the server, i.e the rate that the server sends updates to clients. Clients will need
to set the
cl_updaterate_mp
convar to benefit from increased update rates. Sets thesv_updaterate_mp
,sv_minupdaterate
andsv_max_snapshots_multiplayer
convars. - Default:
20
- Example:
update-rate = 60
- Sets the minimum update rate for the server, if the server can't maintain sending updates at this rate it will
throttle ticks to a point where it can. Sets the
sv_minupdaterate
convar. - Default:
20
- Example:
min-update-rate = 20
- Sets the timescale for the server, slowing down or speeding up the game for all players. Sets the
host_timescale
convar. - Default:
1
- Example:
timescale = 0.5
- Whether this server should be registered with the master server, allowing it to be shown on the in-game server list.
Sets the
ns_report_server_to_masterserver
convar. - Default:
true
- Example:
report-to-master = false
- The URL of the master server, only used if
report-to-master
is true. Sets thens_masterserver_hostname
convar. - Default:
"https://northstar.tf"
- Example:
master-url = "https://my.custom.master.com"
- Whether to allow players to join without master server auth/persistence. You probably don't want to change this.
Sets the
ns_auth_allow_insecure
convar. - Default:
false
- Example:
allow-insecure = false
- Keep this enabled to be able to connect to a server running on the same machine as the client.
Sets the
net_usesocketsforloopback
convar. - Default:
true
- Example:
use-sockets-for-loopback = false
- Unlock all weapons, attachments, skins, etc. Sets the
everything_unlocked
convar. - Default:
true
- Example:
everything_unlocked = true
- Whether the server should return to the private match lobby after completing a game. When false, this will
immediately start the next map/mode in the playlist. Sets the
ns_should_return_to_lobby
convar. - Default:
true
- Example:
should-return-to-lobby = false
- Sets the level of game changes players can make in the private lobby screen. Sets the
ns_private_match_only_host_can_change_settings
convar. - Possible values:
"all"
- players can change all settings."map-mode-only"
- players can only change the map and mode."none"
- players can change no settings.
- Default:
"all"
- Example:
player-permissions = "none"
- When enabled, players will not be able to start matches from the private lobby screen. Sets the
ns_private_match_only_host_can_start
convar. - Default:
false
- Example:
only-host-can-start = true
- The duration of the countdown in the private lobby screen, before a match is started.
Sets the
ns_private_match_countdown_length
convar. - Default:
15
- Example:
countdown-length-seconds = 30
- A list of paths to directories of mods to install on the server, relative to the config file.
- Default:
[]
- Example:
mods-dir = [ "mods/TeamShuffle", "mods/AutoBalance" ]
- A directory where game log files will be saved, relative to the config file. Each file will be named in the format
servername YYYY-MM-DD hh-mm-ss.txt
, and only the newest 5 log files will be kept around. - Default:
"r2wraith-logs/servername"
- Example:
logs-dir = "/server/logs/my-server"
- Allows enabling software rendering for true-headless dedicated servers.
- Possible values:
"default"
,"software"
- Default:
"default"
- Example:
graphics-mode = "software"
- A cron schedule expression that indicates when the server should be automatically restarted. Times are in UTC.
- Default: not set
- Example:
restart-schedule = "0 0 2 * * * *"
- Sets the playlist used by this server, determining which maps and modes are active. Sets the
setplaylist
convar. - Default:
"private_match"
- Example:
playlist = "tdm"
- Limits the server to only play a specific gamemode. You probably want to set
default-mode
too, so the server starts in the desired gamemode. Sets themp_gamemode
convar. - Default: not set
- Example:
mode = "ctf"
- Limits the server to only play on a specific map. You probably want to set
default-map
too, so the server starts in the desired map. Sets themap
convar. - Default: not set
- Example:
map = "mp_forwardbase_kodai"
- Sets the initial selected gamemode in the private match screen. Sets the
ns_private_match_last_mode
convar. - Default: not set (Northstar defaults to
"tdm"
) - Example:
default-mode = "ctf"
- Sets the initial selected map in the private match screen. Sets the
ns_private_match_last_map
convar. - Default: not set (Northstar defaults to
"mp_forwardbase_kodai"
) - Example:
default-map = "mp_forwardbase_kodai"
- A list of riffs (optional gamemode modifications) to enable.
- Possible values:
"floor-is-lava"
,"all-holopilot"
,"all-grapple"
,"all-phase"
,"all-ticks"
,"tactikill"
,"amped-tacticals"
,"rocket-arena"
,"shotguns-snipers"
,"iron-rules"
,"first-person-embark"
,"instagib"
- Default:
[]
- Example:
riffs = [ "floor-is-lava", "shotguns-snipers" ]
The following playlist overrides can be set. Use extra-playlist-vars
to set any that aren't supported.
match-classic-mp-enabled
-true
/false
match-epilogue-enabled
-true
/false
match-scorelimit
- numbermatch-round-scorelimit
- numbermatch-timelimit
- numbermatch-round-timelimit
- numbermatch-oob-timer-enabled
-true
/false
match-max-players
- numbertitan-boost-meter-multiplier
- numbertitan-aegis-upgrades-enabled
-true
/false
titan-infinite-doomed-state-enabled
-true
/false
titan-shield-regen-enabled
-true
/false
titan-classic-rodeo-enabled
-true
/false
pilot-bleedout-mode
-"default"
/"disabled"
/"enabled"
pilot-bleedout-holster-when-down
-true
/false
pilot-bleedout-die-on-team-bleedout
-true
/false
pilot-bleedout-bleedout-time
- numberpilot-bleedout-firstaid-time
- numberpilot-bleedout-selfres-time
- numberpilot-bleedout-firstaid-heal-percent
- numberpilot-bleedout-down-ai-miss-chance
- numberpromode-weapons-enabled
-true
/false
pilot-health-multiplier
- numberpilot-respawn-delay
- numberpilot-boosts-enabled
-true
/false
pilot-boost-meter-overdrive
-"enabled"
/"disabled"
/"only"
pilot-boost-meter-multiplier
- numberpilot-air-acceleration
- numberpilot-collision-enabled
-true
/false
- A map of any extra playlist override vars to set. These will override playlist vars set via other methods.
- Example:
extra-playlist-vars = { myvar = "10", enablesquids = "1" }
- A map of any extra convars to set. These will override convars set via other methods.
- Example:
extra-vars = { ns_will_beep = "1" }
- A list of any extra command-line arguments to pass.
- Example:
extra-args = [ "-coolmode", "-Pong", "20" ]
- A list of Docker bind mounts in shortform
-v
syntax. - Example:
extra-binds = [ "/mods/NoSP/burnmeter.gnut:/usr/lib/northstar/R2Northstar/mods/Northstar.CustomServers/mod/scripts/vscripts/burnmeter/_burnmeter.gnut:ro" ]
R2Wraith is written in Rust. Install the latest stable version with Rustup
then run cargo build
in the repository to build, and cargo run
to build and run.
R2Wraith is provided under the MIT license. Check the LICENSE file for details.