Server Config File – Arma 2

From Bohemia Interactive Community
Jump to navigation Jump to search
(→‎Server Security: syntaxhighlight)
m (Fix link)
 
(111 intermediate revisions by 13 users not shown)
Line 1: Line 1:
==Introduction==
{{TOC|side}}{{Feature|arma3|This page is for games '''before''' {{arma3}}. For a dedicated {{arma3}} page, see [[Arma 3: Server Config File]].}}
This article deals with the '''server.cfg''', a configuration file which you can use to configure various game server settings such as the difficulty level, how many votes are needed, and welcome messages. ''etc.''


The name ''server.cfg'' means nothing, and this file can be called anything. The real name is determined by the <tt>[[-config]]</tt> command line option when launching the dedicated server. There is no default name - when you do not specify the filename, no server configuration file is loaded.


Please feel free to add more information.  
This article deals with the '''server.cfg''', a configuration file which you can use to configure various game server settings such as the difficulty level, how many votes are needed, welcome messages, etc.


==Server Options==
The name ''server.cfg'' is only a standard as the file can be called anything. The real name is determined by the {{hl|[[:Category:Startup Parameters|-config]]}} command line option when launching the dedicated server. There is no default name - when no filename is specified, no server configuration file is loaded.
{| class="bikitable" style="width:100%;"
 
! style="width:30%;" | Parameter     !! Description
 
{{Clear}}
== Server Options ==
 
{| class="wikitable sortable" style="width: 100%"
! style="width: 30%" | Parameter !! Description
|-
|-
| <tt>passwordAdmin = "xyzxyz";</tt> || Password to protect admin access.
| <syntaxhighlight lang="cpp" inline>passwordAdmin = "xyzxyz";</syntaxhighlight> || Password to protect admin access.
|-
|-
| <tt>password = "xyz";</tt>         || Password required to connect to server.
| <syntaxhighlight lang="cpp" inline>password = "xyz";</syntaxhighlight> || Password required to connect to server.
|-
|-
| <tt>serverCommandPassword = "xyzxyz";</tt>         || Password required by alternate syntax of [[serverCommand]] server-side scripting.
| <syntaxhighlight lang="cpp" inline>serverCommandPassword = "xyzxyz";</syntaxhighlight> || Password required by alternate syntax of [[serverCommand]] server-side scripting.
|-
|-
| <tt>hostname="My Server";</tt>     || Servername visible in the game browser.
| <syntaxhighlight lang="cpp" inline>hostname = "My Server";</syntaxhighlight> || Servername visible in the game browser.
|-
|-
| <tt>maxPlayers = 10;</tt>         || The maximum number of players that can connect to server ( seems to be out by 1 in the demo at least ). Number of mission slots override this setting.
| <syntaxhighlight lang="cpp" inline>maxPlayers = 10;</syntaxhighlight> || The maximum number of players that can connect to server. The final number will be lesser between number given here and number of mission slots (default value is 64 for dedicated server).
|-
|-
| <tt>motd[]= {"Welcome to my server.", "Hosted in the net."};</tt> || Two lines welcome message. Comma is the 'new line' separator.
| <syntaxhighlight lang="cpp" inline>motd[] = { "Welcome to my server.", "Hosted in the net." };</syntaxhighlight> || Two lines welcome message. Comma is the 'new line' separator.
|-
|-
| <tt>admins[] = {"<UID>"};</tt> || e.g. admins[]={"1234","5678"}; whitelisted client can use #login w/o password (since Arma 3 1.69+). See [[server.cfg#Logged_In_Admin|Logged In Admin]]
| <syntaxhighlight lang="cpp" inline>admins[] = { "<UID>" };</syntaxhighlight> || e.g. <syntaxhighlight lang="cpp" inline>admins[] = { "1234", "5678" };</syntaxhighlight> whitelisted client can use #login w/o password (since {{Name|arma2oa|short}}). See {{Link|#Logged In Admin}}
|-
|-
| <tt>headlessClients[] = {"<IP>"};</tt> || see [[server.cfg#Dedicated_client_in_Headless_Client_mode|Headless Client Settings]]
| <syntaxhighlight lang="cpp" inline>headlessClients[] = { "<IP>" };</syntaxhighlight> || rowspan="2" colspan="2" align="left" | see [[Arma 2: Server Config File#Dedicated_client_in_Headless_Client_mode|Headless Client Settings]]
|-
|-
| <tt>localClient[] = {"<IP>"};</tt> || see [[server.cfg#Dedicated_client_in_Headless_Client_mode|Headless Client Settings]]
| <syntaxhighlight lang="cpp" inline>localClient[] = { "<IP>" };</syntaxhighlight>
|}
|}


=== Server Behaviour ===


{| class="bikitable" style="width:100%;"
{| class="wikitable sortable" style="width: 100%"
! style="width:30%;" | Server Behavior !! Description
! style="width: 30%" | Server Behaviour !! Description
|-
| <syntaxhighlight lang="cpp" inline>voteThreshold = 0.33;</syntaxhighlight> || Percentage of votes needed to confirm a vote. {{hl|33%}} in this example.
|-
|-
| <tt>voteThreshold = 0.33;</tt>       || Percentage of votes needed to confirm a vote. <tt>33%</tt> in this example.
| <syntaxhighlight lang="cpp" inline>voteMissionPlayers = 3;</syntaxhighlight> || Start mission-voting when ''X'' numberOfPlayers connect. {{hl|3}} players in this example.
|-
|-
| <tt>voteMissionPlayers = 3;</tt>     || Start mission-voting when ''X'' numberOfPlayers connect. <tt>3</tt> players in this example.
| <syntaxhighlight lang="cpp" inline>allowedVoteCmds[] = { { "kick", false, false, 0.75 } };</syntaxhighlight> || rowspan="2" colspan="2" align="left" | see [[Arma_3:_Mission_voting|Mission voting]]
|-
|-
| <tt>reportingIP = "<>";</tt>         ||
| <syntaxhighlight lang="cpp" inline>allowedVotedAdminCmds[] = { { "mission", true, true } };</syntaxhighlight>
* Private server - no reporting: "noreport".
* {{Name|arma|short}}: "armedass.master.gamespy.com" to report to the gamespy master server.
* {{Name|arma2|short}}: "arma2pc.master.gamespy.com"
* {{Name|oa|short}}: "arma2oapc.master.gamespy.com" //this option is deprecated since A2: OA version 1.63
* {{Name|arma3|short}}: "" //not used at all in Arma 3
|-
|-
| <tt>kickduplicate = 1;</tt>         || Do not allow duplicate ''game IDs''. Second player with an existing ID will be kicked automatically. <tt>1</tt> means active, <tt>0</tt> disabled.
| <syntaxhighlight lang="cpp" inline>kickDuplicate = 1;</syntaxhighlight> || Do not allow duplicate ''game IDs''. Second player with an existing ID will be kicked automatically. {{hl|1}} means active, {{hl|0}} disabled.
|-
|-
| <tt>loopback = true;</tt>         || While using the Dev version of Arma III, adding this option will force server into LAN mode. This will allow multiple local instances of the game to connect to the server for testing purposes. At the same time it will prevent all non-local instances from connecting.
| <syntaxhighlight lang="cpp" inline>loopback = true;</syntaxhighlight> || Adding this option will force server into LAN mode. This will allow multiple local instances of the game to connect to the server for testing purposes. At the same time it will prevent all non-local instances from connecting.
|-
|-
| <tt>checkfiles[]= {"dta\bin.pbo", "a10\config.bin"};</tt> || '''Outdated - replaced by [[ArmA:_Addon_Signatures|verifySignatures]]!''' Only use if you really understand what it does.
| <syntaxhighlight lang="cpp" inline>checkfiles[] = { "dta\bin.pbo", "a10\config.bin" };</syntaxhighlight> || '''Outdated - replaced by [[ArmA:_Addon_Signatures|verifySignatures]]!''' Only use if you really understand what it does.


List of files to check for integrity with ''crc check''. Possible to check ''pbo files'' or files inside ''pbos''.
List of files to check for integrity with ''crc check''. Possible to check ''pbo files'' or files inside ''pbos''.
Line 54: Line 55:
Beware checking large files, which takes serious processing on the server and can cause various issues.
Beware checking large files, which takes serious processing on the server and can cause various issues.
|-
|-
| <tt>equalModRequired = 1;</tt>       || '''Outdated - replaced by [[ArmA:_Addon_Signatures|verifySignatures]]!''' Only use if you really understand what it does.
| <syntaxhighlight lang="cpp" inline>equalModRequired = 1;</syntaxhighlight> || '''Outdated - replaced by [[ArmA:_Addon_Signatures|verifySignatures]]!''' Only use if you really understand what it does.


Clients require the exact same ''modfolder'' naming, order and amount as the server. <tt>1</tt> means active, <tt>0</tt> disabled.
Clients require the exact same ''modfolder'' naming, order and amount as the server. {{hl|1}} means active, {{hl|0}} disabled.
|-
|-
| <tt>upnp = 1;</tt>             || Automatically creates port mapping on UPNP/IGD enabled router. This option allows you to create a server behind NAT (your router must have public IP and support UPNP/IGD protocol).  
| <syntaxhighlight lang="cpp" inline>upnp = true;</syntaxhighlight> || Default: false. Automatically creates port mapping on UPNP/IGD enabled router. This option allows you to create a server behind NAT (your router must have public IP and support UPNP/IGD protocol).
Read more [https://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol Internet Gateway Device (IGD) Standardized Device Control Protocol] .  
Read more {{Link|https://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol|Internet Gateway Device (IGD) Standardized Device Control Protocol}} .


Warning: When enabled then this setting may delay server start-up by 600s (standard UDP timeout of 10 minutes) if blocked on firewall or bad routing etc. Thus in such case is recommended to disable it.
Warning: When enabled then this setting may delay server start-up by 600s (standard UDP timeout of 10 minutes) if blocked on firewall or bad routing etc. Thus in such case is recommended to disable it.
|-
| <tt>allowedFilePatching = 0;</tt>          || Prevent or allow file patching for the clients (including the HC) (since Arma 3 1.49+)
* 0 is no clients (default)
* 1 is Headless Clients only
* 2 is all clients
|-
|-
| <tt>disconnectTimeout = 5;</tt>       || Server wait time before disconnecting client, default 90 seconds, range 5 to 90 seconds. (since Arma 3 1.56+)
| <syntaxhighlight lang="cpp" inline>allowedHTMLLoadURIs[] = { "http://arma2.com" };</syntaxhighlight> || Only allow files from listed URIs and URLs to be loaded via [[htmlLoad]] command. Comment out if not used. Can use += to add to the existing list.
|-
| <syntaxhighlight lang="cpp" inline>filePatchingExceptions[] = { "123456789", "987654321" };</syntaxhighlight> || Whitelisted Steam IDs allowed filePatching
|-
| <syntaxhighlight lang="cpp" inline>enablePlayerDiag = 1:</syntaxhighlight> || Logs players' bandwidth and desync info every 60 seconds, as well as "network message is pending" owner identity.
|-
| <syntaxhighlight lang="cpp" inline>callExtReportLimit = 1000.0;</syntaxhighlight> || If server initiated [[callExtension]] takes longer than specified limit in milliseconds, the warning will be logged into server {{hl|.rpt}} file as well as reflected in the extension return result. Default: 1000.0
|-
|-
| <tt>maxdesync = 150;</tt>       || Max desync value until server kick the user (since Arma 3 1.56+)
| <syntaxhighlight lang="cpp" inline>missionsToServerRestart = 8;</syntaxhighlight> || Number of times missionEnd happens before server initiate process restart (uses actual session startup command-line parameters, not possible to combine with `missionsToShutdown` )<br>
|-
|-
| <tt>maxping= 200;</tt>       || Max ping value until server kick the user (since Arma 3 1.56+)
| <syntaxhighlight lang="cpp" inline>missionsToShutdown = 8;</syntaxhighlight> || Number of times missionEnd happens before server initiate process shutdown (has same behavior as setting named `missionsToHardRestart`)<br>
|-
|-
| <tt>maxpacketloss= 50;</tt>       || Max packetloss value until server kick the user (since Arma 3 1.56+)
| <syntaxhighlight lang="cpp" inline>autoSelectMission = true;</syntaxhighlight> || When enabled, the server auto-starts next mission in mission cycle and waits for players in the role selection.<br>
This allows full mission information in server browser and then results in proper filtering of the servers.<br>
This is lesser-variant (trimmed) of server startup command-line parameter `-autoInit`<br>
Might collide with campaign linked missions / need mission cycle etc.
|-
|-
| <tt>kickClientsOnSlowNetwork[] = { 0, 0, 0, 0 };</tt>       || Defines if {<MaxPing>, <MaxPacketLoss>, <MaxDesync>, <DisconnectTimeout>} will be logged (0) or kicked (1)  (since Arma 3 1.56+)
| <syntaxhighlight lang="cpp" inline>randomMissionOrder = true;</syntaxhighlight> || When enabled, the server random start / next selection with one of missions from mission rotation list. ( setting goes outside(before) Mission class {}; )
|-
| <syntaxhighlight lang="cpp" inline>disableChannels[] = { { 0, false, true } };</syntaxhighlight> ||
<syntaxhighlight lang="cpp" inline>disableChannels[] = { { channelID, text, voice }, ... };</syntaxhighlight>
* ''ChannelID'' : [[Number]] - use single digit of (0 to 6) to define channelID. Default: No restriction to any channels, with text/von chat set to false.
* ''text'' : [[Boolean]] - use [[true]] to disable usage of text-chat for defined channelID. Default: '''[[false]]'''
* ''voice'' : [[Boolean]] - use [[true]] to disable usage of voice-chat (VON) for defined channelID. Default: '''[[false]]'''
List of channels ID:
{{Columns|4|
* 0 {{=}} Global
* 1 {{=}} Side
* 2 {{=}} Command
* 3 {{=}} Group
* 4 {{=}} Vehicle
* 5 {{=}} Direct
* 6 {{=}} System
}}
{{Feature|informative|A mission which uses [[Description.ext#disableChannels|disableChannels]] will override any setting of ''disableChannels[]'' in the '''server.cfg'''.}}
|}
|}


=== Arma server only ===


{| class="bikitable" style="width:100%;"
{{Feature|informative|the following settings do not apply to {{ofp}}.}}
! style="width:30%;" | Arma Only Parameters !! Description
 
|-
{| class="wikitable sortable" style="width: 100%"
| <tt>verifySignatures = 2;</tt>            || Enables or disables the [[ArmA: Addon Signatures|signature verification]] for addons.
! style="width: 30%" | Arma Only Parameters !! Description
* Default = <tt>0</tt>.
* Weak protection = <tt>1</tt>.
* Full protection = <tt>2</tt>.
From Arma 3 use only level <tt>2</tt> (level <tt>1</tt> is outdated and not efficent) - [https://forums.bistudio.com/showthread.php?t=115114 Changed in 1.59 patch]
|-
|-
| <tt>drawingInMap = 0;</tt>                 || Enables or disables the ability to place markers and draw lines in map. Default = <tt>1</tt> (since Arma 3 1.63+).
| <syntaxhighlight lang="cpp" inline>verifySignatures = 2;</syntaxhighlight> || Enables or disables the [[ArmA: Addon Signatures|signature verification]] for addons.
* Default = {{hl|2}}.
* Verification disabled = {{hl|0}}.
|-
|-
| <tt>disableVoN = 1;</tt>                 || Enables or disables the '''''V'''oice '''o'''ver '''N'''et''. Default = <tt>0</tt>.
| <syntaxhighlight lang="cpp" inline>disableVoN = 1;</syntaxhighlight> || Enables or disables the '''''V'''oice '''o'''ver '''N'''et''. Default = {{hl|0}}.
|-
|-
| <tt>vonCodecQuality = 10;</tt>           || Defines ''VoN'' codec quality. Value range is from <tt>1</tt> to <tt>20</tt>.
| <syntaxhighlight lang="cpp" inline>vonCodecQuality = 10;</syntaxhighlight> || Defines ''VoN'' codec quality. Value range is from {{hl|1}} to {{hl|20}}.
* Default = <tt>3</tt>.
* Default = {{hl|3}}.
* Since 1.62.95417 supports range <tt>1-20</tt>
* Since {{Name|arma2oa|short}} 1.62.95417 supports range {{hl|1-20}}
* Since 1.63.x will support range <tt>1-30</tt>
* Since {{Name|arma2oa|short}} 1.63.x will support range {{hl|1-30}}
* 8kHz is <tt>0-10</tt>, 16kHz is <tt>11-20</tt>, for <tt>21-30</tt> it's 32kHz for SPEEX codec and 48kHz for OPUS codec.
* 8kHz is {{hl|0-10}}, 16kHz is {{hl|11-20}}, for {{hl|21-30}} it is 32kHz for SPEEX codec and 48kHz for OPUS codec.
|-
|-
| <tt>vonCodec = 1;</tt>           || Defines ''VoN'' codec type. Value range is from <tt>0</tt> to <tt>1</tt>.
| <syntaxhighlight lang="cpp" inline>vonCodec = 1;</syntaxhighlight> || Defines ''VoN'' codec type. Value range is from {{hl|0}} to {{hl|1}}.
* Default = <tt>0</tt>.
* Default = {{hl|0}}.
* Since Arma 3 update 1.58 supports value <tt>1</tt>
* Value {{hl|0}} uses older {{Link|https://en.wikipedia.org/wiki/Speex|SPEEX codec}}, while {{hl|1}} switches to new IETF standard {{Link|https://en.wikipedia.org/wiki/Opus_(audio_format)|OPUS codec}}.
* Value <tt>0</tt> uses older [https://en.wikipedia.org/wiki/Speex SPEEX codec], while <tt>1</tt> switches to new IETF standard [https://en.wikipedia.org/wiki/Opus_(audio_format) OPUS codec].
|-
|-
| <tt>logFile = "server_console.log";</tt> || Enables output of dedicated server console into ''textfile''. Default location of log is same as ''crash dumps'' and other logs.
| <syntaxhighlight lang="cpp" inline>skipLobby = true;</syntaxhighlight> || If true, joining player will skip role selection. This is only used if no Mission, Campaign or Config setting {{hl|skipLobby}} is defined (See [[Description.ext#skipLobby]]). Default: false;
|-
|-
(Local settings) Note that this does not change the location of the "''net.log''" file, which you enable with the <tt>-netlog</tt> command line option.
| <syntaxhighlight lang="cpp" inline>logFile = "server_console.log";</syntaxhighlight> || Enables output of dedicated server console into ''textfile''. Default location of log is same as ''crash dumps'' and other logs.<br>
(Local settings) Note that this does not change the location of the "''net.log''" file, which you enable with the {{hl|-netlog}} command line option.
|-
|-
| <tt>doubleIdDetected = "command";</tt>   || rowspan="7" colspan="2" align="center" | see [[ArmA: Server Side Scripting|Server Side Scripting]]
| <syntaxhighlight lang="cpp" inline>doubleIdDetected = "command";</syntaxhighlight> || rowspan="7" colspan="2" align="center" | see [[ArmA: Armed Assault: Server Side Scripting|Server Side Scripting]]
|-
|-
| <tt>onUserConnected = "command";</tt>
| <syntaxhighlight lang="cpp" inline>onUserConnected = "command";</syntaxhighlight>
|-
|-
| <tt>onUserDisconnected = "command";</tt>
| <syntaxhighlight lang="cpp" inline>onUserDisconnected = "command";</syntaxhighlight>
|-
|-
| <tt>onHackedData = "command";</tt>
| <syntaxhighlight lang="cpp" inline>onHackedData = "command";</syntaxhighlight>
|-
|-
| <tt>onDifferentData = "command";</tt>
| <syntaxhighlight lang="cpp" inline>onDifferentData = "command";</syntaxhighlight>
|-
|-
| <tt>onUnsignedData = "command";</tt>
| <syntaxhighlight lang="cpp" inline>onUnsignedData = "command";</syntaxhighlight>
|-
|-
| <tt>regularCheck = "command";</tt>
| <syntaxhighlight lang="cpp" inline>onUserKicked = "command";</syntaxhighlight>
|-
|-
| <tt>BattlEye = 1;</tt>                    || Enables or disables the [[BattlEye]] anti-cheat engine. Default <tt>0</tt>. - since 1.09 beta, in Arma 3 default is 1. Note that this requires specific dlls to be installed on the server and all clients joining the game
| <syntaxhighlight lang="cpp" inline>regularCheck = "command";</syntaxhighlight>
|-
|-
| <tt>timeStampFormat = "short";</tt>       || Set the timestamp format used on each report line in server-side [[Crash Files|RPT file]]. Possible values are "none" (default), "short", "full".
| <syntaxhighlight lang="cpp" inline>BattlEye = 1;</syntaxhighlight> || Enables or disables the [[BattlEye]] anti-cheat engine. Default {{hl|0}}. Requires installed battleye on server and clients joining the server
|-
|-
| <tt>forceRotorLibSimulation = 0;</tt>     || Enforces the Advanced Flight Model on the server. Default = <tt>0</tt> (up to the player). <tt>1</tt> - forced AFM, <tt>2</tt> - forced SFM.
| <syntaxhighlight lang="cpp" inline>timeStampFormat = "short";</syntaxhighlight> || Set the timestamp format used on each report line in server-side [[Crash Files|RPT file]]. Possible values are "none" (default), "short", "full".
|-
|-
| <tt>persistent = 1;</tt>                 || Enables or disables the ''persistent battlefield''. Default = <tt>0</tt>. See note below.
| <syntaxhighlight lang="cpp" inline>forceRotorLibSimulation = 0;</syntaxhighlight> || Enforces the Advanced Flight Model on the server. Default = {{hl|0}} (up to the player). {{hl|1}} - forced AFM, {{hl|2}} - forced SFM.
|-
|-
| <tt>requiredBuild = xxxxx;</tt>           || From 1.60 Patchlog: <tt>requiredBuild=xxxxx;</tt> in ''server.cfg'' preventing obsolete clients to connect. Since 95691 the required version is limited to the server version.
| <syntaxhighlight lang="cpp" inline>persistent = 1;</syntaxhighlight> || Mission keeps running when all clients disconnect.. Default = {{hl|0}}. See note below.
|-
|-
| <tt>forcedDifficulty = "regular";</tt>                 || see [[server.cfg#Arma_3_-_Forced_difficulty|Forced difficulty]]  (since Arma 3 1.56+)
| <syntaxhighlight lang="cpp" inline>requiredBuild = xxxxx;</syntaxhighlight> || Minimum required client version. Clients with version lower than {{hl|requiredBuild}} will not be able to connect. If {{hl|requiredBuild}} is set to a large number, like {{hl|c= requiredBuild = 999999999;}} for example, it will automatically be lowered to the current server version.
|-
|-
| <tt>missionWhitelist[] = {"intro.altis"};</tt>                  || Limit the available missions for the admin for the mission change  (since Arma 3 1.56+)
|}
|}


=== Comments ===


=== Comments ===
Enabling the persistence option will make missions that have either ''base'' or ''instant'' respawn keep on running after all players have disconnected.
Enabling the persistence option will make missions that have either ''base'' or ''instant'' respawn keep on running after all players have disconnected.
The other respawn types will not make a mission persistent. The kind of respawn a certain mission uses is set in its [[Description.ext]].
The other respawn types will not make a mission persistent. The kind of respawn a certain mission uses is set in its [[Description.ext]].


If you do not include the ''regularCheck'' option or set <tt>regularCheck = "";</tt> it will be activated.
If you do not include the ''regularCheck'' option or set {{hl|c= regularCheck = "";}} it will be activated automatically.
 
The server checks the files from time to time by hashing them and comparing the hash to the hash values of the clients.
The server checks the files from time to time by hashing them and comparing the hash to the hash values of the clients.
:The heavy ''<span title="In/Out">I/O</span>'' operation might be stressful for some systems with weak I/O, slow HDD etc.
{{Feature|important|It is strongly recommended to '''not disable''' {{hl|regularCheck}} as this will make the server prone to cheating.<br>
:In case you still have these problems post 1.60 release, please [https://dev-heaven.net/projects/cis/issues/new report to CIT ticket with details].
 
To turn this function off, write <tt>regularCheck = "{}";</tt>. '''It's strongly recommended to NOT DISABLE regularCheck as this will make the server prone to cheating.'''
 
==Server Voting==
Documentation for server-side voting settings (since 1.39 DEV)
===allowedVoteCmds===
;Definition of available voting commands:<br>
:allowedVoteCmds[] = { { "CMD1", pre-init, post-init, threshold },{ "CMD2", pre-init, post-init, threshold }, ... ,{ "CMDn", pre-init, post-init, threshold }};
 
Second, third and fourth parameters are optional. If not specified, pre-init and post-init are true by default. (pre-init means prior to mission start, post-init means after a mission started)  <br>
Threshold equals "voteThreshold" by default.<br>
;Not listing any command ( allowedVoteCmds[] = {}; ) means voting is disabled. <br>
;Not specifing allowedVoteCmds at all means everything is allowed!<br>
 
Example:
:allowedVoteCmds[] = {
:{"admin", true, true, 0.5},
:{"missions", true, "true", "0.5"},
:{"mission", true, true}, // will use global "voteThreshold"
:{"kick", false, false, 0.75},
:{"restart", false, true, -1}, // invalid threshold value. Will default to global "voteThreshold"
:{"reassign", true, true, 0.5}
:};
----


===allowedVotedAdminCmds===
;Definition of available commands for voted-in admins (this doesn't affect abilities of normal server admins):
:allowedVotedAdminCmds[] = { { "CMD1", pre-init, post-init },{ "CMD2", pre-init, post-init }, ... ,{ "CMDn", pre-init, post-init }};


Second and third parameter are optional. If not specified otherwise, they are true by default. (pre-init means prior to mission start, post-init means after a mission started) <br>
== Server Administration ==
;Not listing any command ( allowedVotedAdminCmds[] = {}; ) means such commands are disabled for voted-in admin. <br>
;Not specifing allowedVotedAdminCmds at all means everything is allowed anytime for voted-in admin!


Commands available for voted admins:
If you are not using BattlEye RCon, there could only be 1 server admin at any given time. There are two ways of becoming admin, through a vote or through login with authenticated credentials.
:allowedVotedAdminCmds[] = {
:{"mission", true, true}, //
:{"missions", true, true}, //
:{"restart", true, true}, //
:{"reassign", true, true}, //
:{"kick", true, true}  //
:};
----


===Global voting settings===
=== Voted In Admin ===
Global voting settings are used if no voting threshold defined in allowedVoteCmds or/and allowedVotedAdminCmds
:voteThreshold = <number>; // Percentage of votes needed to confirm a vote.
:voteMissionPlayers = <number>; //Start mission-voting when ''X'' numberOfPlayers connect.
----


==Server Administration==
It is possible to become a server administrator through player voting process. Such admin has less abilities than logged in admin.<br>
If you are not using BattlEye RCon, there could only be 1 server admin at any given time. There are two ways of becoming admin, through a vote or through login with authenticated credentials.  
For example, voted in admin would be able to kick a player, but only logged in admin would be able to ban a player.<br>
For more information on voting and voting configuration see page [[Arma_3:_Mission_voting|'''Server Voting''']].


===Voted In Admin===
=== Logged In Admin ===
It is possible to become a server administrator through player voting process. Such admin has less abilities than logged in admin. For example, voted in admin would be able to kick a player, but only logged in admin would be able to ban a player. For more information on voting and voting configuration see [[server.cfg#Server_Voting|Server Voting]].


===Logged In Admin===
To log in as admin, one is required to type in{{hl|#login}} command followed by server password, which matches password defined in '''passwordAdmin''' param.<br>
To log in as admin, one is required to type in<tt>#login</tt> command followed by server password, which matches password defined in '''passwordAdmin''' param. Since Arma2OA it is possible to add one or several user ids [[getPlayerUID|UIDs]] into '''admins[]''' server config parameter, which would allow listed users to log in as admin by simply typing <tt>#login</tt> without a password. This presents several advantages for managing the servers. The server owner can have multiple admins selected from the community and doesn't have to provide each one with server admin password. The adding and removing of UIDs is done on the server side which makes it easy to add and to remove admins if necessary. On the server, admins are handled on first come first served basis. Here are the rules:
Since Arma2OA it is possible to add one or several user ids [[getPlayerUID|UIDs]] into '''admins[]''' server config parameter, which would allow listed users to log in as admin by simply typing {{hl|#login}} without a password.<br>
This presents several advantages for managing the servers. The server owner can have multiple admins selected from the community and doesn't have to provide each one with server admin password.<br>
The adding and removing of UIDs is done on the server side which makes it easy to add and to remove admins if necessary. On the server, admins are handled on first come first served basis.<br>
Here are the rules:<br>
* If there is already a logged in admin on the server, the new admin will not be able to log in until previously logged in admin logs out
* If there is already a logged in admin on the server, the new admin will not be able to log in until previously logged in admin logs out
* If there is a voted in admin on the server, the logged in admin will override voted in admin and take admin role
* If there is a voted in admin on the server, the logged in admin will override voted in admin and take admin role
* There is no difference between logged in admin that used admin password or logged in admin that was whitelisted with '''admins[]''' param
* There is no difference between logged in admin that used admin password or logged in admin that was whitelisted with '''admins[]''' param
The logged in and voted in admins have different set of [[Multiplayer Server Commands]] available to them. See [[serverCommandAvailable]] for more information.
<br>
 
The logged in and voted in admins have different set of '''[[Multiplayer Server Commands]]''' available to them. See '''[[serverCommandAvailable]]''' for more information.
==Server Security==
Several of these settings directly contribute to the security of the server and have been highlighted as important, particularly for running Public (no password) servers.


;The most updated ones that give a good protection (and are, ''de facto'', the standard for public servers) are:
=== Server Security ===
<syntaxhighlight lang=cpp>
battlEye = 1;
verifySignatures = 2;
allowedFilePatching = 0;
allowedLoadFileExtensions[] = {"hpp","sqs","sqf","fsm","cpp","paa","txt","xml","inc","ext","sqm","ods","fxy","lip","csv","kb","bik","bikb","html","htm","biedi"};
allowedPreprocessFileExtensions[] = {"hpp","sqs","sqf","fsm","cpp","paa","txt","xml","inc","ext","sqm","ods","fxy","lip","csv","kb","bik","bikb","html","htm","biedi"};
allowedHTMLLoadExtensions[] = {"htm","html","xml","txt"};
//allowedHTMLLoadURIs[] = {};
passwordAdmin = "xyzxyz123";
serverCommandPassword = "xyzxyz456";
</syntaxhighlight>


'''Note:''' allowedLoad*/allowedPreprocess*/allowedHTML* are server.cfg settings with array list of extensions, for server-side use only. <br>
See {{Link|Arma 3: Server Config File#Server Security}} for security settings.
Above are listed examples for basic-game MP modes, server-admin may attempt to make it stricter for theirs servers (if too strict then server's log file will contain warning entries about unable read)<br>
With the exception of allowedHTMLLoadURIs those arrays covers both files inside and outside PBOs so don't change the above defaults w/o testing first as there's a chance you'll break the game. <br>
'''Warning:''' Not listing any extension means ''everything is allowed''. Defining the setting as empty arrays means ''nothing is allowed''.<br>
To read [[loadFile]] , [[preprocessFile]] , [[preprocessFileLineNumbers]] and to remember, those works on files only-within Arma 3 server directory and it's sub-directories !
:Refer to [[ArmA: Addon Signatures]] for current best practices in server mod signing and the use of key signature files.<br>


To further increase security of your servers remember [[BattlEye]] has ability to utilize server-side (including preventing remote execution) and client-side script check filters.<br>
:'''Note:''' these BattlEye filters needs to be written specifically for each mission and mod as the scripting differs in each of them.<br>


'''To understand:''' Engine supports absolute (full path) outside Arma 3 server folder for command-line parameters ''-servermod='', ''-mod='' and same for profile directories and config locations<br>
== Example Configuration File ==
this puts those out of reach by various load script command features which are limited only within Arma 3 folder and it's sub-directories (for logical security reason)<br>
thus e.g. safe folder-structure looks like:<br>
\arma3server\<br>
\arma3server\@publicmods\<br>
\arma3server_servermods_secrethash\<br>
\arma3server_profiles_and_configs_secrethash\<br>
yet note that callExtensions are loaded only from arma 3 server root / subfolders


==Example Configuration File==
<syntaxhighlight lang="cpp">
<syntaxhighlight lang="c">
//
//
// server.cfg
// server.cfg
Line 255: Line 206:
// GLOBAL SETTINGS
// GLOBAL SETTINGS
hostname = "Fun and Test Server"; // The name of the server that shall be displayed in the public server list
hostname = "Fun and Test Server"; // The name of the server that shall be displayed in the public server list
password = ""; // Password for joining, eg connecting to the server
password = ""; // Password for joining, eg connecting to the server
passwordAdmin = "xyz"; // Password to become server admin. When you're in Arma MP and connected to the server, type '#login xyz'
passwordAdmin = "xyz"; // Password to become server admin. When you're in Arma MP and connected to the server, type '#login xyz'
serverCommandPassword = "xyzxyz";               // Password required by alternate syntax of [[serverCommand]] server-side scripting.
serverCommandPassword = "xyzxyz"; // Password required by alternate syntax of [[serverCommand]] server-side scripting.
 
//reportingIP = "armedass.master.gamespy.com"; // For {{arma1}} publicly list your server on GameSpy. Leave empty for private servers
//reportingIP = "arma2pc.master.gamespy.com"; // For {{arma2}} publicly list your server on GameSpy. Leave empty for private servers
//reportingIP = "arma2oapc.master.gamespy.com"; // For {{arma2oa}} - deprecated since {{arma2oa}} version 1.63


//reportingIP = "armedass.master.gamespy.com"; // For ArmA1 publicly list your server on GameSpy. Leave empty for private servers
//reportingIP = "arma2pc.master.gamespy.com"; // For ArmA2 publicly list your server on GameSpy. Leave empty for private servers
//reportingIP = "arma2oapc.master.gamespy.com"; // For Arma2: Operation Arrowhead  //this option is deprecated since A2: OA version 1.63
//reportingIP = "arma3" //not used at all
logFile = "server_console.log"; // Tells ArmA-server where the logfile should go and what it should be called
logFile = "server_console.log"; // Tells ArmA-server where the logfile should go and what it should be called


Line 270: Line 221:
// Empty messages "" will not be displayed at all but are only for increasing the interval
// Empty messages "" will not be displayed at all but are only for increasing the interval
motd[] = {
motd[] = {
"", "",
"", "",
"Two empty lines above for increasing interval",
"Two empty lines above for increasing interval",
"Welcome to our server",
"Welcome to our server",
"", "",
"", "",
"We are looking for fun - Join us Now !",
"We are looking for fun - Join us Now !",
"http://www.example.com",
"http://www.example.com",
Line 279: Line 230:
""
""
};
};
motdInterval = 5; // Time interval (in seconds) between each message
motdInterval = 5; // Time interval (in seconds) between each message




// JOINING RULES
// JOINING RULES
//checkfiles[] = {}; // Outdated.
//checkfiles[] = {}; // Outdated.
maxPlayers = 64; // Maximum amount of players. Civilians and watchers, beholder, bystanders and so on also count as player.
maxPlayers = 64; // Maximum amount of players. Civilians and watchers, beholder, bystanders and so on also count as player.
kickDuplicate = 1; // Each ArmA version has its own ID. If kickDuplicate is set to 1, a player will be kicked when he joins a server where another player with the same ID is playing.
kickDuplicate = 1; // Each ArmA version has its own ID. If kickDuplicate is set to 1, a player will be kicked when he joins a server where another player with the same ID is playing.
verifySignatures = 2; // Verifies .pbos against .bisign files. Valid values 0 (disabled), 1 (prefer v2 sigs but accept v1 too) and 2 (only v2 sigs are allowed).  
verifySignatures = 2; // Verifies .pbos against .bisign files. Valid values 0 (disabled), 1 (prefer v2 sigs but accept v1 too) and 2 (only v2 sigs are allowed).
equalModRequired = 0; // Outdated. If set to 1, player has to use exactly the same -mod= startup parameter as the server.
equalModRequired = 0; // Outdated. If set to 1, player has to use exactly the same -mod= startup parameter as the server.
allowedFilePatching = 0;                       // Allow or prevent client using -filePatching to join the server. 0, is disallow, 1 is allow HC, 2 is allow all clients (since Arma 3 1.49+)
filePatchingExceptions[] = {"123456789","987654321"}; // Whitelisted Steam IDs allowed to join with -filePatching enabled
//requiredBuild = 12345 // Require clients joining to have at least build 12345 of game, preventing obsolete clients to connect
//requiredBuild = 12345; // Require clients joining to have at least build 12345 of game, preventing obsolete clients to connect




Line 299: Line 250:
// INGAME SETTINGS
// INGAME SETTINGS
disableVoN = 0; // If set to 1, Voice over Net will not be available
disableVoN = 0; // If set to 1, Voice over Net will not be available
vonCodec = 1; // If set to 1 then it uses IETF standard OPUS codec, if to 0 then it uses SPEEX codec (since Arma 3 update 1.58+) 
vonCodecQuality = 30; // since 1.62.95417 supports range 1-20 //since 1.63.x will supports range 1-30 //8kHz is 0-10, 16kHz is 11-20, 32kHz(48kHz) is 21-30
vonCodecQuality = 30; // since 1.62.95417 supports range 1-20 //since 1.63.x will supports range 1-30 //8kHz is 0-10, 16kHz is 11-20, 32kHz(48kHz) is 21-30  
persistent = 1; // If 1, missions still run on even after the last player disconnected.
persistent = 1; // If 1, missions still run on even after the last player disconnected.
timeStampFormat = "short"; // Set the timestamp format used on each report line in server-side RPT file. Possible values are "none" (default),"short","full".
timeStampFormat = "short"; // Set the timestamp format used on each report line in server-side RPT file. Possible values are "none" (default),"short","full".
BattlEye = 1; // Server to use BattlEye system
BattlEye = 1; // Server to use BattlEye system
allowedLoadFileExtensions[] = {"hpp","sqs","sqf","fsm","cpp","paa","txt","xml","inc","ext","sqm","ods","fxy","lip","csv","kb","bik","bikb","html","htm","biedi"}; //only allow files with those extensions to be loaded via loadFile command (since Arma 3 build 1.19.124216)
//allowedHTMLLoadURIs[] = {}; // Leave commented to let missions/campaigns/addons decide what URIs are supported. Uncomment to define server-level restrictions for URIs
allowedPreprocessFileExtensions[] = {"hpp","sqs","sqf","fsm","cpp","paa","txt","xml","inc","ext","sqm","ods","fxy","lip","csv","kb","bik","bikb","html","htm","biedi"}; //only allow files with those extensions to be loaded via preprocessFile/preprocessFileLineNumber commands (since Arma 3 build 1.19.124323)
 
allowedHTMLLoadExtensions[] = {"htm","html","xml","txt"}; //only allow files with those extensions to be loaded via HTMLLoad command (since Arma 3 build 1.27.126715)
// TIMEOUTS
//allowedHTMLLoadURIs = {}; // Leave commented to let missions/campaigns/addons decide what URIs are supported. Uncomment to define server-level restrictions for URIs
disconnectTimeout = 5; // Time to wait before disconnecting a user which temporarly lost connection. Range is 5 to 90 seconds.
disconnectTimeout = 5; // Server wait time before disconnecting client, default 90 seconds, range 5 to 90 seconds. (since Arma 3 update 1.56+) 
maxDesync = 150; // Max desync value until server kick the user
maxPing= 200; // Max ping value until server kick the user
maxPacketLoss= 50; // Max packetloss value until server kick the user
kickClientsOnSlowNetwork[] = { 0, 0, 0, 0 }; // Defines if {<MaxPing>, <MaxPacketLoss>, <MaxDesync>, <DisconnectTimeout>} will be logged (0) or kicked (1)
kickTimeout[] = { {0, -1}, {1, 180}, {2, 180}, {3, 180} };
votingTimeOut[] = {60, 90}; // Kicks users from server if they spend too much time in mission voting
roleTimeOut[] = {90, 120}; // Kicks users from server if they spend too much time in role selection
briefingTimeOut[] = {60, 90}; // Kicks users from server if they spend too much time in briefing (map) screen
debriefingTimeOut[] = {45, 60}; // Kicks users from server if they spend too much time in debriefing screen
lobbyIdleTimeout = 300; // The amount of time the server will wait before force-starting a mission without a logged-in Admin.
 


// SCRIPTING ISSUES
// SCRIPTING ISSUES
onUserConnected = ""; //
onUserConnected = "";
onUserDisconnected = ""; //
onUserDisconnected = "";
doubleIdDetected = ""; //
doubleIdDetected = "";
//regularCheck = "{}"; // Server checks files from time to time by hashing them and comparing the hash to the hash values of the clients. //deprecated
//regularCheck = "{}"; // Server checks files from time to time by hashing them and comparing the hash to the hash values of the clients. //deprecated


// SIGNATURE VERIFICATION
// SIGNATURE VERIFICATION
Line 323: Line 283:


// MISSIONS CYCLE (see below)
// MISSIONS CYCLE (see below)
class Missions {}; // An empty Missions class means there will be no mission rotation
randomMissionOrder = true; // Randomly iterate through Missions list
autoSelectMission = true; // Server auto selects next mission in cycle


missionWhitelist[] = {}; //an empty whitelist means there is no restriction on what missions' available
class Missions {}; // An empty Missions class means there will be no mission rotation
 
missionWhitelist[] = {}; // An empty whitelist means there is no restriction on what missions' available


</syntaxhighlight>
</syntaxhighlight>


=== Mission rotation ===
=== Mission rotation ===
One can set an automatic mission rotation. It will automatically select a mission join a player joins with no admin logged in{{Clarify}}. Once the mission is done and if there are still players on the server, it automatically switches to the next in the cycle.


==== Arma ====
One can set an automatic mission rotation. Without an admin, the server will automatically select a mission when at least one player is connected. Once the mission is done and if there are still players on the server, it will automatically switch to the next in the cycle.
The following example shows one for the missions included with the demo.  


<syntaxhighlight lang="c">
Example:<br>
class Missions
{
class MPCTF_01 // name for the mission, can be anything
{
template = M02CaptureTheFlag.SaraLite; // omit the .pbo suffix
cadetMode = 1; // difficulty 0=veteran 1=cadet
};
class MPCOOP_01
{
template = M01Cooperative.SaraLite;
cadetMode = 1;
};
class MPCTI_01
{
template = M03ConquerTheIsland.SaraLite;
cadetMode = 1;
};
};
</syntaxhighlight>


==== Arma 2 ====
{{Feature|informative|When difficulty is set to {{hl|c= difficulty {{=}} "Custom";}} the server will look into {{hl|USERNAME.ArmaXProfile}} file for the definition of custom difficulty, which should look like this: [[server.armaprofile#Server_Difficulty_Example | click to see example]]}}
This example shows how to put all the stock Arma 2 1.05 multiplayer missions into rotation:


<syntaxhighlight lang="c">
<syntaxhighlight lang="cpp">
class Missions
class Missions
{
{
class DM_Deathmatch
class TestMission01
{
template = "MP_Deathmatch.Chernarus"; // omit the .pbo suffix
difficulty = "recruit"; // difficulty: recruit, regular, veteran or mercenary (see CfgDifficulties in the main game config)
};
class DM_Detector
{
template = "MP_Detector.Chernarus";
difficulty = "regular";
};
class Team_TeamDeathmatch
{
{
template = "MP_TeamDeathmatch.Chernarus";
template = "MP_Marksmen_01.Altis";
difficulty = "veteran";
difficulty = "veteran";
class Params {};
};
};
class COOP_Paradrop
{
template = "MP_Paradrop.Chernarus";
difficulty = "mercenary";
};
class CTI_CivilWar
{
template = "MP_CivilWar.Chernarus";
difficulty = "regular";
};
class CTI_SuperPowers
{
template = "MP_Superpowers.Chernarus";
difficulty = "regular";
};
class CTI_WarWelcome
{
template = "MP_WarWelcome.utes";
difficulty = "regular";
};
class CTI_WhenDiplomacyFails
{
template = "MP_WhenDiplomacyFails.Chernarus";
difficulty = "regular";
};
};
</syntaxhighlight>
==== Arma 2: Operation Arrowhead ====
This example contains all the MP missions from the Operation Arrowhead expansion:


<syntaxhighlight lang="c">
class TestMission02
class Missions
{
class COOP_HikeInTheHills
{
{
template = "MPE1_HikeInTheHills.Takistan"; // omit the .pbo suffix
template = "MP_End_Game_01.Altis";
difficulty = "regular"; // difficulty: recruit, regular, veteran or mercenary (see CfgDifficulties in the main game config)
};
class COOP_LaserShow
{
template = "MPE1_LaserShow.Takistan";
difficulty = "regular";
};
class COOP_Littlebird
{
template = "MPE1_Littlebird.Takistan";
difficulty = "regular";
};
class COOP_OneShotOneKill
{
template = "MPE1_OneShotOneKill.Takistan";
difficulty = "regular";
};
class COOP_SteelPanthers
{
template = "MPE_SteelPanthers.Takistan";
difficulty = "regular";
};
class CTI_MountainWarfare
{
template = "MPE_MountainWarfare.Takistan";
difficulty = "regular";
};
class CTI_MountainWarfare3Sided
{
template = "MPE_MountainWarfare3Sided.Takistan";
difficulty = "regular";
};
class CTI_UrbanWarfare
{
template = "MP_UrbanWarfare.Zargabad";
difficulty = "regular";
};
class SCont_SectorControl
{
template = "MPE_SectorControl.Zargabad";
difficulty = "veteran";
difficulty = "veteran";
class Params {};
};
};
class DM_Dogfighters
 
class TestMission03
{
{
template = "MPE1_Dogfighters.Takistan";
template = "MP_End_Game_02.Altis";
difficulty = "veteran";
difficulty = "veteran";
class Params {};
};
};
class Team_HuntersHunted
 
class TestMission04
{
{
template = "MPE1_HuntersHunted.Takistan";
template = "MP_End_Game_03.Altis";
difficulty = "veteran";
difficulty = "veteran";
};
class Params {};
};
</syntaxhighlight>
=== Arma 2: Operation Arrowhead - multiple mission parameters configuration ===
Starting rev.72235 (22.7.2010) the Operation Arrowhead should be able not only to use multiple mission parameters, but also configure their defaults in ''server.cfg'' config file.
 
Below is a short example of how it was tested when implemented. Feel free to rewrite this part of article, as I only want to stop speculations how these parameters are to be configured. This should be considered as a documentation just after implementation.
 
<syntaxhighlight lang="c">
// description.ext file: definition of parameters with their defaults.
// These default values can be overwritten in the server.cfg, as shown in the following list
titleParam1 = "Secretary dress";
valuesParam1[] = {0, 1, 2, 3};
defValueParam1 = 0;
textsParam1[] = {"Bikini", "Miniskirt", "Tunic", "Jeans"};
 
titleParam2 = "Secretary age";
valuesParam2[] = {18, 20, 26, 30, 35, 80};
defValueParam2 = 26;
textsParam2[] = {"18", "20", "26", "30", "35", "Baba Jaga"};
 
class Params
{
class Name
{
title = "Secretary name";
values[] = {0, 1, 2, 3};
texts[] = {"Iveta", "Mila", "Misa", "Bara"};
default = 3;
};
class WorkPlace
{
title = "Secretary place";
values[] = {0, 1};
texts[] = {"Prague","Mnisek"};
default = 1;
};
class Friend
{
title = "Her friend"
values[] = {0, 1};
texts[] = {"None","Bebul"};
default = 1;
};
};
</syntaxhighlight>
 
Inside ''server.cfg'' one can define the <tt>param1</tt> and <tt>param2</tt> values along with new, named parameters inside ''class Params'', using each parameter ''class name'' to assign the corresponding parameter the value.
:The '''paramsArray''' cannot be used inside ''server.cfg'' config file (or you can use it, but the engine has never read it :) ).
<syntaxhighlight lang="c">
class Missions
{
class CanBeAnything // name for the mission, can be anything
{
template = "parametersTest.Desert_E"; // omit the .pbo suffix
difficulty = "regular"; // difficulty: recruit, regular, veteran & mercenary as specified in *.Arma2profile
param1 = 2; // dress
param2 = 26; // age
class Params
{
Name = 2;
WorkPlace = 0;
Friend = 1;
};
};
};
</syntaxhighlight>
 
=== Arma 3: APEX  -  mission collection ===
Mainly intended for MP campaigns. If the progress is defined in the MPMissions class, server administrator can simply add the whole campaign by adding ''campaign class'' into the ''server.cfg''. See the example below.
 
'''config.cpp:'''
<syntaxhighlight lang="c">
class MPMissions
{
class Apex
{
briefingName = $STR_A3_CoopCampaignName;
 
class EXP_m01
{
briefingName = $STR_A3_exp_m01_missionname;
directory = "a3\missions_f_exp\campaign\missions\exp_m01.tanoa";
};
class EXP_m02
{
briefingName = $STR_A3_exp_m02_missionname;
directory = "a3\missions_f_exp\campaign\missions\exp_m02.tanoa";
};
class EXP_m03
{
briefingName = $STR_A3_exp_m03_missionname;
directory = "a3\missions_f_exp\campaign\missions\exp_m03.tanoa";
};
};
</syntaxhighlight>
 
'''server.cfg:'''
<syntaxhighlight lang="c">
 
// MISSIONS CYCLE
class Missions
{
class Apex{};
};
</syntaxhighlight>
 
Also the difficulty of the each mission can be overridden
 
<syntaxhighlight lang="c">
class Missions
{
class Apex
{
class EXP_m01
  {
  difficulty = "veteran";
  };
};
};
};
};
Line 592: Line 335:
=== Dedicated client in Headless Client mode ===
=== Dedicated client in Headless Client mode ===


{| class="bikitable"
{| class="wikitable" style="width: 100%"
! Parameter     !! Description
! style="width: 30%" | Parameter !! Description
|-
|-
| <tt>localClient[]={"127.0.0.1", ...};</tt> || to indicate clients with ''unlimited'' bandwidth and ''nearly no latency'' (https://dev-heaven.net/issues/62500), Available since Arma 2:OA build 99184 , including Arma 3
| <syntaxhighlight lang="cpp" inline>localClient[]={"127.0.0.1", ...};</syntaxhighlight> || to indicate clients with ''unlimited'' bandwidth and ''nearly no latency'' ({{Link|https://dev-heaven.net/issues/62500}}), Available since {{arma2oa}} build 99184
|-
|-
| <tt>headlessClients[]={"127.0.0.1", ...};</tt> || The server doesn't allow arbitrary connections from headless clients if you do not define the headless clients IPs. <br> Multiple Connections and Addresses are allowed in the case of more than one Headless Client.
| <syntaxhighlight lang="cpp" inline>headlessClients[]={"127.0.0.1", ...};</syntaxhighlight> || The server doesn't allow arbitrary connections from headless clients if you do not define the headless clients IPs.<br> Multiple Connections and Addresses are allowed in the case of more than one Headless Client.
|}
|}


More details at [[Arma_3_Headless_Client|Headless Client]]
{{Feature|informative|See [[Arma 3: Headless Client]] for more information.}}
 
=== Arma 2: Operation Arrowhead & Arma 3 - STEAM ports configuration ===


note: STEAM ports in Arma 3 build 1.22.125469 or newer are '''hardcoded as now linked to game-port of the server instance (+1 query +2 report to master)'''
=== {{arma2oa}} - STEAM ports configuration ===


{| class="bikitable"
{| class="wikitable" style="width: 100%"
! Parameter     !! Description
! style="width: 30%" | Parameter !! Description
|-
|-
| <tt>steamPort = <number>;</tt>     || default <tt>2303</tt>, defines port for communication with STEAM services, needs to be unique for each dedicated server within one OS instance / network interface
| <syntaxhighlight lang="cpp" inline>steamPort = <number>;</syntaxhighlight> || default {{hl|2303}}, defines port for communication with STEAM services, needs to be unique for each dedicated server within one OS instance / network interface
|-
|-
| <tt>steamQueryPort = <number>;</tt> || default <tt>2304</tt>, defines port for server's STEAM query, needs to be unique for each dedicated server within one OS instance / network interface
| <syntaxhighlight lang="cpp" inline>steamQueryPort = <number>;</syntaxhighlight> || default {{hl|2304}}, defines port for server's STEAM query, needs to be unique for each dedicated server within one OS instance / network interface
|}
|}
=== Arma 3 - Mission white-listing ===
The following example shows only Zeus and Karts missions allowed e.g. via voting and mission select.
<syntaxhighlight lang="c">


missionWhitelist[] = {
=== Overriding mission params ===
"MP_COOP_m04.Stratis",
"MP_COOP_m05.Altis",
"MP_COOP_m06.Altis",
"MP_COOP_m07.Altis",
"MP_ZGM_m11.Altis",
"MP_ZGM_m11_EAST.Altis",
"MP_ZGM_m11_GUER.Altis",
"MP_ZGM_m11_WEST.Altis",
"MP_ZGM_m12.Stratis",
"MP_ZGM_m12_EAST.Stratis",
"MP_ZGM_m12_GUER.Stratis",
"MP_ZGM_m12_WEST.Stratis",
"MP_ZSC_m10.Altis",
"MP_ZGM_m13.VR",
"MP_ZGM_m13_EAST.VR",
"MP_ZGM_m13_GUER.VR",
"MP_ZGM_m13_WEST.VR",
"MP_ZR_8_Karts01.Altis",
"MP_ZR_8_Karts02.Stratis",
"MP_bootcamp_01.VR",
"MP_Bootcamp_01.Altis",
};
</syntaxhighlight>


=== Arma 3 - Forced difficulty ===
On dedicated server unless you are an admin you cannot set mission options provided by mission maker via class Params. However as a server owner you can override default setting with your own. See [[Mission Parameters]] for more info


Enforces the selected difficulty on the server.
<br><br>
<tt>'''forcedDifficulty''' = "<difficultyClass>";</tt>
<br><br>
* If Recruit, Regular or Veteran is passed as the parameter, the particular difficulty options will be taken from data config, from the class CfgDifficultyPresets.
* If Custom will be passed as the parameter, the particular flags will be taken from CustomDifficulty class from server's profile (only Custom is saved to the profile).
* If mission cycle is defined in the [[server.cfg]], the difficulty set in the mission cycle overrides the difficulty set by '''forcedDifficulty''' parameter.


=== Arma 3 - Analytics configuration ===
== See Also ==
 
{| class="bikitable"
! Parameter      !! Description
|-
| <tt>statisticsEnabled = <number>;</tt>      || default <tt>1</tt>, allows to opt-out of [[Arma 3 Analytics|analytics]] for the server by using 0
|}


==== Additional details====
* [[ArmA: Armed Assault: Server configuration|Server Configuration]]
For hosting server behind NAT or firewall, please ensure gameport and STEAMports are forwarded and open! <br>
* [[basic.cfg|Server Basic Config file]]
Set the ICMP "echo reply" as allowed so the server is able return ping delay properly. <br>
* [[Arma 2: Startup Parameters]]
It's recommended to enable the NAT traversal (so called "Edge traversal" in Windows Firewall) for '''arma3server.exe''', '''arma3.exe''' to better support clients/servers behind NAT.
* [[Arma 3: Startup Parameters]]
* [[ArmA: Armed Assault: Dedicated Server]]
* [[Arma 3: Dedicated Server]]
* [[ArmA: Armed Assault: Server Side Scripting]]
* [[Operation Flashpoint: Dedicated Server]]
* [[Arma 3: Headless Client]]
* [[Arma 3: Server Security]]
* [[Arma 3: Mission voting]]
* [[Arma: Mission rotation]]
* [[Arma 2 Mission Rotation]]
* [[Arma 2 OA: Multiple Mission Parameters Configuration]]


==See Also==
*[[ArmA: Server configuration|Server Configuration]]
*[[Armed Assault:Dedicated Server]]
*[[ArmA: Server Side Scripting]]
*[[Operation Flashpoint:Dedicated Server]]
*[[Arma_3_Headless_Client]]


[[Category:Operation Flashpoint: Multiplayer|Server.cfg]]
{{GameCategory|ofp|Multiplayer}}
[[Category:ArmA: Multiplayer|Server.cfg]]
{{GameCategory|arma1|Multiplayer}}
{{GameCategory|arma2|Multiplayer}}

Latest revision as of 17:33, 26 July 2024

Arma 3
This page is for games before Arma 3. For a dedicated Arma 3 page, see Arma 3: Server Config File.


This article deals with the server.cfg, a configuration file which you can use to configure various game server settings such as the difficulty level, how many votes are needed, welcome messages, etc.

The name server.cfg is only a standard as the file can be called anything. The real name is determined by the -config command line option when launching the dedicated server. There is no default name - when no filename is specified, no server configuration file is loaded.


Server Options

Parameter Description
passwordAdmin = "xyzxyz"; Password to protect admin access.
password = "xyz"; Password required to connect to server.
serverCommandPassword = "xyzxyz"; Password required by alternate syntax of serverCommand server-side scripting.
hostname = "My Server"; Servername visible in the game browser.
maxPlayers = 10; The maximum number of players that can connect to server. The final number will be lesser between number given here and number of mission slots (default value is 64 for dedicated server).
motd[] = { "Welcome to my server.", "Hosted in the net." }; Two lines welcome message. Comma is the 'new line' separator.
admins[] = { "<UID>" }; e.g. admins[] = { "1234", "5678" }; whitelisted client can use #login w/o password (since Arma 2:OA). See Logged In Admin
headlessClients[] = { "<IP>" }; see Headless Client Settings
localClient[] = { "<IP>" };

Server Behaviour

Server Behaviour Description
voteThreshold = 0.33; Percentage of votes needed to confirm a vote. 33% in this example.
voteMissionPlayers = 3; Start mission-voting when X numberOfPlayers connect. 3 players in this example.
allowedVoteCmds[] = { { "kick", false, false, 0.75 } }; see Mission voting
allowedVotedAdminCmds[] = { { "mission", true, true } };
kickDuplicate = 1; Do not allow duplicate game IDs. Second player with an existing ID will be kicked automatically. 1 means active, 0 disabled.
loopback = true; Adding this option will force server into LAN mode. This will allow multiple local instances of the game to connect to the server for testing purposes. At the same time it will prevent all non-local instances from connecting.
checkfiles[] = { "dta\bin.pbo", "a10\config.bin" }; Outdated - replaced by verifySignatures! Only use if you really understand what it does.

List of files to check for integrity with crc check. Possible to check pbo files or files inside pbos.

Beware checking large files, which takes serious processing on the server and can cause various issues.

equalModRequired = 1; Outdated - replaced by verifySignatures! Only use if you really understand what it does.

Clients require the exact same modfolder naming, order and amount as the server. 1 means active, 0 disabled.

upnp = true; Default: false. Automatically creates port mapping on UPNP/IGD enabled router. This option allows you to create a server behind NAT (your router must have public IP and support UPNP/IGD protocol).

Read more Internet Gateway Device (IGD) Standardized Device Control Protocol .

Warning: When enabled then this setting may delay server start-up by 600s (standard UDP timeout of 10 minutes) if blocked on firewall or bad routing etc. Thus in such case is recommended to disable it.

allowedHTMLLoadURIs[] = { "http://arma2.com" }; Only allow files from listed URIs and URLs to be loaded via htmlLoad command. Comment out if not used. Can use += to add to the existing list.
filePatchingExceptions[] = { "123456789", "987654321" }; Whitelisted Steam IDs allowed filePatching
enablePlayerDiag = 1: Logs players' bandwidth and desync info every 60 seconds, as well as "network message is pending" owner identity.
callExtReportLimit = 1000.0; If server initiated callExtension takes longer than specified limit in milliseconds, the warning will be logged into server .rpt file as well as reflected in the extension return result. Default: 1000.0
missionsToServerRestart = 8; Number of times missionEnd happens before server initiate process restart (uses actual session startup command-line parameters, not possible to combine with `missionsToShutdown` )
missionsToShutdown = 8; Number of times missionEnd happens before server initiate process shutdown (has same behavior as setting named `missionsToHardRestart`)
autoSelectMission = true; When enabled, the server auto-starts next mission in mission cycle and waits for players in the role selection.

This allows full mission information in server browser and then results in proper filtering of the servers.
This is lesser-variant (trimmed) of server startup command-line parameter `-autoInit`
Might collide with campaign linked missions / need mission cycle etc.

randomMissionOrder = true; When enabled, the server random start / next selection with one of missions from mission rotation list. ( setting goes outside(before) Mission class {}; )
disableChannels[] = { { 0, false, true } };

disableChannels[] = { { channelID, text, voice }, ... };

  • ChannelID : Number - use single digit of (0 to 6) to define channelID. Default: No restriction to any channels, with text/von chat set to false.
  • text : Boolean - use true to disable usage of text-chat for defined channelID. Default: false
  • voice : Boolean - use true to disable usage of voice-chat (VON) for defined channelID. Default: false

List of channels ID:

  • 0 = Global
  • 1 = Side
  • 2 = Command
  • 3 = Group
  • 4 = Vehicle
  • 5 = Direct
  • 6 = System
A mission which uses disableChannels will override any setting of disableChannels[] in the server.cfg.

Arma server only

the following settings do not apply to Operation Flashpoint.
Arma Only Parameters Description
verifySignatures = 2; Enables or disables the signature verification for addons.
  • Default = 2.
  • Verification disabled = 0.
disableVoN = 1; Enables or disables the Voice over Net. Default = 0.
vonCodecQuality = 10; Defines VoN codec quality. Value range is from 1 to 20.
  • Default = 3.
  • Since Arma 2:OA 1.62.95417 supports range 1-20
  • Since Arma 2:OA 1.63.x will support range 1-30
  • 8kHz is 0-10, 16kHz is 11-20, for 21-30 it is 32kHz for SPEEX codec and 48kHz for OPUS codec.
vonCodec = 1; Defines VoN codec type. Value range is from 0 to 1.
skipLobby = true; If true, joining player will skip role selection. This is only used if no Mission, Campaign or Config setting skipLobby is defined (See Description.ext#skipLobby). Default: false;
logFile = "server_console.log"; Enables output of dedicated server console into textfile. Default location of log is same as crash dumps and other logs.

(Local settings) Note that this does not change the location of the "net.log" file, which you enable with the -netlog command line option.

doubleIdDetected = "command"; see Server Side Scripting
onUserConnected = "command";
onUserDisconnected = "command";
onHackedData = "command";
onDifferentData = "command";
onUnsignedData = "command";
onUserKicked = "command";
regularCheck = "command";
BattlEye = 1; Enables or disables the BattlEye anti-cheat engine. Default 0. Requires installed battleye on server and clients joining the server
timeStampFormat = "short"; Set the timestamp format used on each report line in server-side RPT file. Possible values are "none" (default), "short", "full".
forceRotorLibSimulation = 0; Enforces the Advanced Flight Model on the server. Default = 0 (up to the player). 1 - forced AFM, 2 - forced SFM.
persistent = 1; Mission keeps running when all clients disconnect.. Default = 0. See note below.
requiredBuild = xxxxx; Minimum required client version. Clients with version lower than requiredBuild will not be able to connect. If requiredBuild is set to a large number, like requiredBuild = 999999999; for example, it will automatically be lowered to the current server version.

Comments

Enabling the persistence option will make missions that have either base or instant respawn keep on running after all players have disconnected. The other respawn types will not make a mission persistent. The kind of respawn a certain mission uses is set in its Description.ext.

If you do not include the regularCheck option or set regularCheck = ""; it will be activated automatically. The server checks the files from time to time by hashing them and comparing the hash to the hash values of the clients. {{Feature|important|It is strongly recommended to not disable regularCheck as this will make the server prone to cheating.


Server Administration

If you are not using BattlEye RCon, there could only be 1 server admin at any given time. There are two ways of becoming admin, through a vote or through login with authenticated credentials.

Voted In Admin

It is possible to become a server administrator through player voting process. Such admin has less abilities than logged in admin.
For example, voted in admin would be able to kick a player, but only logged in admin would be able to ban a player.
For more information on voting and voting configuration see page Server Voting.

Logged In Admin

To log in as admin, one is required to type in#login command followed by server password, which matches password defined in passwordAdmin param.
Since Arma2OA it is possible to add one or several user ids UIDs into admins[] server config parameter, which would allow listed users to log in as admin by simply typing #login without a password.
This presents several advantages for managing the servers. The server owner can have multiple admins selected from the community and doesn't have to provide each one with server admin password.
The adding and removing of UIDs is done on the server side which makes it easy to add and to remove admins if necessary. On the server, admins are handled on first come first served basis.
Here are the rules:

  • If there is already a logged in admin on the server, the new admin will not be able to log in until previously logged in admin logs out
  • If there is a voted in admin on the server, the logged in admin will override voted in admin and take admin role
  • There is no difference between logged in admin that used admin password or logged in admin that was whitelisted with admins[] param


The logged in and voted in admins have different set of Multiplayer Server Commands available to them. See serverCommandAvailable for more information.

Server Security

See Arma 3: Server Config File - Server Security for security settings.


Example Configuration File

//
// server.cfg
//
// comments are written with "//" in front of them.


// GLOBAL SETTINGS
hostname = "Fun and Test Server";		// The name of the server that shall be displayed in the public server list
password = "";							// Password for joining, eg connecting to the server
passwordAdmin = "xyz";					// Password to become server admin. When you're in Arma MP and connected to the server, type '#login xyz'
serverCommandPassword = "xyzxyz";		// Password required by alternate syntax of [[serverCommand]] server-side scripting.

//reportingIP = "armedass.master.gamespy.com";	// For {{arma1}} publicly list your server on GameSpy. Leave empty for private servers
//reportingIP = "arma2pc.master.gamespy.com";	// For {{arma2}} publicly list your server on GameSpy. Leave empty for private servers
//reportingIP = "arma2oapc.master.gamespy.com";	// For {{arma2oa}} - deprecated since {{arma2oa}} version 1.63

logFile = "server_console.log";			// Tells ArmA-server where the logfile should go and what it should be called


// WELCOME MESSAGE ("message of the day")
// It can be several lines, separated by comma
// Empty messages "" will not be displayed at all but are only for increasing the interval
motd[] = {
	"", "",
	"Two empty lines above for increasing interval",
	"Welcome to our server",
	"", "",
	"We are looking for fun - Join us Now !",
	"http://www.example.com",
	"One more empty line below for increasing interval",
	""
};
motdInterval = 5;					// Time interval (in seconds) between each message


// JOINING RULES
//checkfiles[] = {};				// Outdated.
maxPlayers = 64;					// Maximum amount of players. Civilians and watchers, beholder, bystanders and so on also count as player.
kickDuplicate = 1;					// Each ArmA version has its own ID. If kickDuplicate is set to 1, a player will be kicked when he joins a server where another player with the same ID is playing.
verifySignatures = 2;				// Verifies .pbos against .bisign files. Valid values 0 (disabled), 1 (prefer v2 sigs but accept v1 too) and 2 (only v2 sigs are allowed).
equalModRequired = 0;				// Outdated. If set to 1, player has to use exactly the same -mod= startup parameter as the server.
filePatchingExceptions[] = {"123456789","987654321"}; // Whitelisted Steam IDs allowed to join with -filePatching enabled
//requiredBuild = 12345;			// Require clients joining to have at least build 12345 of game, preventing obsolete clients to connect


// VOTING
voteMissionPlayers = 1;				// Tells the server how many people must connect so that it displays the mission selection screen.
voteThreshold = 0.33;				// 33% or more players need to vote for something, for example an admin or a new map, to become effective


// INGAME SETTINGS
disableVoN = 0;					// If set to 1, Voice over Net will not be available
vonCodecQuality = 30;			// since 1.62.95417 supports range 1-20 //since 1.63.x will supports range 1-30 //8kHz is 0-10, 16kHz is 11-20, 32kHz(48kHz) is 21-30
persistent = 1;					// If 1, missions still run on even after the last player disconnected.
timeStampFormat = "short";		// Set the timestamp format used on each report line in server-side RPT file. Possible values are "none" (default),"short","full".
BattlEye = 1;					// Server to use BattlEye system
//allowedHTMLLoadURIs[] = {}; // Leave commented to let missions/campaigns/addons decide what URIs are supported. Uncomment to define server-level restrictions for URIs

// TIMEOUTS
disconnectTimeout = 5;			// Time to wait before disconnecting a user which temporarly lost connection. Range is 5 to 90 seconds.
maxDesync = 150;				// Max desync value until server kick the user
maxPing= 200;					// Max ping value until server kick the user
maxPacketLoss= 50;				// Max packetloss value until server kick the user
kickClientsOnSlowNetwork[] = { 0, 0, 0, 0 }; // Defines if {<MaxPing>, <MaxPacketLoss>, <MaxDesync>, <DisconnectTimeout>} will be logged (0) or kicked (1)
kickTimeout[] = { {0, -1}, {1, 180}, {2, 180}, {3, 180} };
votingTimeOut[] = {60, 90};		// Kicks users from server if they spend too much time in mission voting
roleTimeOut[] = {90, 120};		// Kicks users from server if they spend too much time in role selection
briefingTimeOut[] = {60, 90};	// Kicks users from server if they spend too much time in briefing (map) screen
debriefingTimeOut[] = {45, 60};	// Kicks users from server if they spend too much time in debriefing screen
lobbyIdleTimeout = 300;			// The amount of time the server will wait before force-starting a mission without a logged-in Admin.


// SCRIPTING ISSUES
onUserConnected = "";
onUserDisconnected = "";
doubleIdDetected = "";
//regularCheck = "{}";				// Server checks files from time to time by hashing them and comparing the hash to the hash values of the clients. //deprecated

// SIGNATURE VERIFICATION
onUnsignedData = "kick (_this select 0)";	// unsigned data detected
onHackedData = "kick (_this select 0)";		// tampering of the signature detected
onDifferentData = "";				// data with a valid signature, but different version than the one present on server detected


// MISSIONS CYCLE (see below)
randomMissionOrder = true;	// Randomly iterate through Missions list
autoSelectMission = true;	// Server auto selects next mission in cycle

class Missions {};			// An empty Missions class means there will be no mission rotation

missionWhitelist[] = {};	// An empty whitelist means there is no restriction on what missions' available

Mission rotation

One can set an automatic mission rotation. Without an admin, the server will automatically select a mission when at least one player is connected. Once the mission is done and if there are still players on the server, it will automatically switch to the next in the cycle.

Example:

When difficulty is set to difficulty = "Custom"; the server will look into USERNAME.ArmaXProfile file for the definition of custom difficulty, which should look like this: click to see example
class Missions
{
	class TestMission01
	{
		template = "MP_Marksmen_01.Altis";
		difficulty = "veteran";
		class Params {};
	};

	class TestMission02
	{
		template = "MP_End_Game_01.Altis";
		difficulty = "veteran";
		class Params {};
	};

	class TestMission03
	{
		template = "MP_End_Game_02.Altis";
		difficulty = "veteran";
		class Params {};
	};

	class TestMission04
	{
		template = "MP_End_Game_03.Altis";
		difficulty = "veteran";
		class Params {};
	};
};

Dedicated client in Headless Client mode

Parameter Description
localClient[]={"127.0.0.1", ...}; to indicate clients with unlimited bandwidth and nearly no latency (-dead link-), Available since Arma 2: Operation Arrowhead build 99184
headlessClients[]={"127.0.0.1", ...}; The server doesn't allow arbitrary connections from headless clients if you do not define the headless clients IPs.
Multiple Connections and Addresses are allowed in the case of more than one Headless Client.
See Arma 3: Headless Client for more information.

Arma 2: Operation Arrowhead - STEAM ports configuration

Parameter Description
steamPort = <number>; default 2303, defines port for communication with STEAM services, needs to be unique for each dedicated server within one OS instance / network interface
steamQueryPort = <number>; default 2304, defines port for server's STEAM query, needs to be unique for each dedicated server within one OS instance / network interface

Overriding mission params

On dedicated server unless you are an admin you cannot set mission options provided by mission maker via class Params. However as a server owner you can override default setting with your own. See Mission Parameters for more info


See Also