Server Configuration

From Soldat2 Wiki
Revision as of 11:02, 10 June 2023 by Nerf cardboard (talk | contribs) (layout)
Jump to navigation Jump to search

Configuration is split across several locations:

  • autoconfig.ini - basic settings like server name, password, player limit, bot count, lobby mode.
  • Rules/ - each JSON file defines a game mode (eg CTF, DM, etc). In these files match duration, score limit, teams, default weapon selection, medkits, etcpp are defined.
  • Levels/Custom/ - Contains custom maps. Get some maps from TMS2. See also: Mapping Guide.
  • Modifiers/ - Contains modifiers that customize some parameters of the game (and can be voted for by players in the lobby for each match). See Custom Modifiers for details.
  • Scripts/ - C# scripts that define custom behaviour. See Category:Scripting.
  • Cycles/ - Map rotations (for when lobby is disabled).
  • greet.txt - Server info message showing in the popup before each match. Supports [TODO custom formatting]


Example Configurations

Use the following public server configurations as examples, or a baseline for your own configuration:

FAQ

autoconfig.ini

Note: only ever write changes to autoconfig.ini after the server has stopped - your changes will be lost as the file is rewritten when the server stops.

Most relevant options are fairly self-explanatory. You should *change at least the following options*:

  • Name - sets the server name
  • MaxPlayers - set the maximum of players on the server

Also, fill greet.txt with your own content - it is displayed at the beginning of each match

All options in autoconfig.ini can be defined via CLI arguments (eg ./soldat2 ServerPassword=foobar), as well as dynamically in-game via rcon commands (eg rcon set ServerPassword foobar).

Manage bots

  • FillBotsCount - the amount of bots added to an empty server. they will be replaced by human players.
  • FillBotsDifficulty - 0 is stupid, 3 is butcher

Set up admin commands

  • AdminPlayfabID - your Playfab ID to be admin automatically (To find your Playfab ID, start the server and join with your client. Your Playfab ID will show up in the server logs as 1 YOUR_NAME joined the server [YOUR_PLAYFAB_ID])
  • RconPassword - if set, more than one player can send admin commands.

Play pre-selected maps & game modes only

  • UseLobby = False
  • AllowVoting = False
  • GamesCycleFile = Cycles/Custom/selected-maps.json

Having this, list the maps you want in your game cycle:

nano Cycles/Custom/selected-maps.json
[{
  "Rules": "Deathmatch",
  "Level": "dm_epitaph"
}]