Server Configuration

From Soldat2 Wiki
Jump to navigation Jump to search

Config Files

autoconfig.ini

Contains basic settings like server name, password, player limit, bot count, lobby mode.

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
  • VisibleInGamesList - set to false, if you host in LAN only, to not confuse external players with your server in the server listing

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.

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).


Rules/*/*.json

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/*/*.json

Contains custom maps. Get some maps from TMS2. See also Mapping Guide.

Modifiers/*/*.json

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/*/*.cs

C# scripts that define custom behaviour. See Category:Modding.

Cycles/*/*.json

Map rotations (for when lobby is disabled).

greet.txt

Server info message showing in the popup before each match. Supports [TODO custom formatting]

Examples

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

How to...

customize match duration, score limit

Edit each file in Rules/Standard/ and set:

  • Match.MatchSecs
  • Match.ScoreLimit

Manage bots

In autoconfig.ini, set:

  • 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

In autoconfig.ini, set:

  • 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

In autoconfig.ini, set:

  • 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"
}]