Server Configuration: Difference between revisions

From Soldat2 Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:Dedicated Server]]
= 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*:
* <code>Name</code> - sets the server name
* <code>MaxPlayers</code> - set the maximum of players on the server
* <code>VisibleInGamesList</code> - 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 <code>./soldat2 ServerPassword=foobar</code>), as well as dynamically in-game via rcon commands (eg <code>rcon set ServerPassword foobar</code>).
 
 
== 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 [https://tms2.jrgp.org/ TMS2]. See also [[Mapping | Mapping Guide]].


Configuration is split across several locations:
== Modifiers/*/*.json ==
* <code>autoconfig.ini</code> - basic settings like server name, password, player limit, bot count, lobby mode.
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.
* <code>Rules/</code> - 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.
* <code>Levels/Custom/</code> - Contains custom maps. Get some maps from [https://tms2.jrgp.org/ TMS2]. See also: [[Mapping | Mapping Guide]].
* <code>Modifiers/</code> - 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.
* <code>Scripts/</code> - C# scripts that define custom behaviour. See [[:Category:Scripting]].
* <code>Cycles/</code> - Map rotations (for when lobby is disabled).
* <code>greet.txt</code> - Server info message showing in the popup before each match. Supports [TODO custom formatting]


= Example Configurations =
== Scripts/*/*.cs ==
C# scripts that define custom behaviour. See [[:Category:Modding]].


Use the following public server configurations as examples, or a baseline for your own configuration:
== Cycles/*/*.json ==
Map rotations (for when lobby is disabled).


* [https://codeberg.org/norwin/soldat2-custom/src/branch/server/nolobby @noerws Vote Fast server] (among others)
== greet.txt ==
Server info message showing in the popup before each match. Supports [TODO custom formatting]


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


== autoconfig.ini ==
* [https://codeberg.org/norwin/soldat2-custom/src/branch/server/nolobby @noerws Vote Fast server] (among others)


'''''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.
= How to... =


Most relevant options are fairly self-explanatory.
== customize match duration, score limit ==
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
Edit each file in <code>Rules/Standard/</code> and set:
* <code>Match.MatchSecs</code>
* <code>Match.ScoreLimit</code>


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


=== Manage bots ===
In autoconfig.ini, set:


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


=== Set up admin commands ===
== 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 <code>1 YOUR_NAME joined the server [YOUR_PLAYFAB_ID]</code>)
* 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 <code>1 YOUR_NAME joined the server [YOUR_PLAYFAB_ID]</code>)
* RconPassword - if set, more than one player can send admin commands.
* RconPassword - if set, more than one player can send admin commands.


=== Play pre-selected maps & game modes only ===
== Play pre-selected maps & game modes only ==
 
In autoconfig.ini, set:


* UseLobby = False
* UseLobby = False
Line 57: Line 79:
}]
}]
</pre>
</pre>
[[Category:Dedicated Server]]

Latest revision as of 17:46, 10 June 2023

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