Server Hosting – Arma Reforger

From Bohemia Interactive Community
Jump to navigation Jump to search
(Update json thanks to Uro)
(Move all Config to Server Config)
Line 3: Line 3:
There are two possible modes in {{armaR}}: '''player-hosted''' and '''dedicated'''.
There are two possible modes in {{armaR}}: '''player-hosted''' and '''dedicated'''.


{{Feature|important|
Two '''very important''' aspects of dedicated server public hosting:
* Keep {{Link|#fastValidation}} to {{hl|true}}
* Limit max FPS with the {{hl|[[Arma Reforger:Startup Parameters#maxFPS|-maxFPS]]}} startup parameter in order to save performance
}}
{{Feature|warning|
'''0.9.8 - 0.9.9 warning:'''
The 0.9.8.73 patch renamed the following entries:
{{{!}} class{{=}}"wikitable"
! New
! rowspan{{=}}"8" {{!}} replaces
! Current
{{!}}-
{{!}} {{hl|{{Link|#bindAddress|"bindAddress"}}}} {{!}}{{!}} {{hl|{{Link|#gameHostBindAddress|"gameHostBindAddress"}}}}
{{!}}-
{{!}} {{hl|{{Link|#bindPort|"bindPort"}}}} {{!}}{{!}} {{hl|{{Link|#gameHostBindPort|"gameHostBindPort"}}}}
{{!}}-
{{!}} {{hl|{{Link|#publicAddress|"publicAddress"}}}} {{!}}{{!}} {{hl|{{Link|#gameHostRegisterBindAddress|"gameHostRegisterBindAddress"}}}}
{{!}}-
{{!}} {{hl|{{Link|#publicPort|"publicPort"}}}} {{!}}{{!}} {{hl|{{Link|#gameHostRegisterPort|"gameHostRegisterPort"}}}}
{{!}}-
{{!}} {{hl|{{Link|#maxPlayers|"maxPlayers"}}}} {{!}}{{!}} {{hl|{{Link|#playerCountLimit|"playerCountLimit"}}}}
{{!}}-
{{!}} {{hl|{{Link|#supportedPlatforms|"supportedPlatforms"}}}} {{!}}{{!}} {{hl|{{Link|#supportedGameClientTypes|"supportedGameClientTypes"}}}}
{{!}}-
{{!}} {{hl|{{Link|#passwordAdmin|"passwordAdmin"}}}} {{!}}{{!}} {{hl|{{Link|#adminPassword|"adminPassword"}}}}<br>It is now located in the {{Link|#game_2|game}} section (the same as {{hl|{{Link|#password}}}})
{{!}}}
Both old and new names will work until the '''0.9.9''' patch where only the new names will exist.<br>
Do '''NOT''' have old and new versions coexist, as behaviour/preference is not guaranteed in this situation.
'''Experimental branch users:''' the 0.9.9.31 patch removed this backward compatibility - only the new naming will work from this point.
}}




Line 87: Line 49:
=== Startup Parameters ===
=== Startup Parameters ===


See {{Link|Arma Reforger:Startup Parameters#Hosting}} and the {{Link|#Configuration}} section below for more information.
See {{Link|Arma Reforger:Startup Parameters#Hosting}} and the {{Link|Arma Reforger:Server Config|Server Config}} page for more information.


==== config ====
==== config ====
Line 110: Line 72:
=== Configuration File ===
=== Configuration File ===


{{Feature|informative|Parameters inside the JSON file are case-sensitive!}}
See {{Link|Arma Reforger:Server Config}}.
{{armaR}} uses JSON configuration format to run. A configuration file looks like this:
<spoiler text="Show Example Configuration">
<syntaxhighlight lang="json">
{
"bindAddress": "0.0.0.0",
"bindPort": 2001,
"publicAddress": "192.168.9.10",
"publicPort": 2001,
"a2s": {
"address": "192.168.9.10",
"port": 17777
},
"game": {
"name": "Server Name - Mission Name",
"password": "",
"passwordAdmin": "changeme",
"scenarioId": "{ECC61978EDCC2B5A}Missions/23_Campaign.conf",
"maxPlayers": 32,
"visible": true,
"crossPlatform": true,
"supportedPlatforms": [
"PLATFORM_PC",
"PLATFORM_XBL"
],
"gameProperties": {
"serverMaxViewDistance": 2500,
"serverMinGrassDistance": 50,
"networkViewDistance": 1000,
"disableThirdPerson": true,
"fastValidation": true,
"battlEye": true,
"VONDisableUI": true,
"VONDisableDirectSpeechUI": true,
"missionHeader": {
"m_iPlayerCount": 40,
"m_eEditableGameFlags": 6,
"m_eDefaultGameFlags": 6,
"other": "values"
}
},
"mods": [
{
"modId": "59727DAE364DEADB",
"name": "WeaponSwitching",
"version": "1.0.1"
},
{
"modId": "59727DAE32981C7D",
"name": "Explosive Goats beta",
"version": "0.5.42"
}
]
},
"operating": {
"lobbyPlayerSynchronise": true
}
}
</syntaxhighlight>
</spoiler>
 
Values are strings, unless mentioned otherwise.
 
===== gameHostBindAddress =====
{{ArgTitle|6|bindAddress|{{GVI|armaR|0.9.9|size= 0.75}}}}
IP address to which the server socket will be bound. In most cases, this should be left empty.
It can be used to restrict connections to particular network interface. When left out or empty, {{hl|0.0.0.0}} is used, which allows connections through any IP address.
{{Feature|important|IP'''v6''' is '''not''' supported by {{armaR}} v0.9.8.}}
 
===== gameHostBindPort =====
{{ArgTitle|6|bindPort|{{GVI|armaR|0.9.9|size= 0.75}}}}
number value, range 1..65535, default: 2001
 
UDP port to which the server socket will be bound.
 
===== gameHostRegisterBindAddress =====
{{ArgTitle|6|publicAddress|{{GVI|armaR|0.9.9|size= 0.75}}}}
IP address registered in backend.
This should be set to the public IP address to which clients can connect in order to reach the server (either IP of the server itself or IP of the machine that will forward data to the server).
When left out or empty, an attempt is made to automatically determine the IP address, but this will often fail and should not be relied upon as the server might not be reachable from public networks.
{{Feature|important|IP'''v6''' is '''not''' supported by {{armaR}} v0.9.8.}}
 
===== gameHostRegisterPort =====
{{ArgTitle|6|publicPort|{{GVI|armaR|0.9.9|size= 0.75}}}}
number value, range 1..65535, default: 2001
 
UDP port registered in backend. If the server itself has a public IP address, this should be the same value as in {{hl|gameHostBindPort}}. Otherwise, this is the UDP port that is forwarded to the server.
 
===== adminPassword =====
Defines the server's admin password, allows a server administrator to login and control the server, to access this either open the chat input box by pressing {{Controls|C}} in the lobby or {{Controls|enter}} in-game followed by: {{hl|#login [the admin password]}}
{{Feature|informative|'''0.9.9''' will move this setting to {{Link|#game 2|game}} as {{Link|#passwordAdmin}}.}}
 
===== a2sQueryEnabled =====
bool value, default: false
 
Enable Steam Query protocol.
 
===== steamQueryPort =====
number value, range 1..65535, default: 17777
 
{{ArgTitle|5|a2s|{{GVI|armaR|0.9.9}}}}
''0.9.9.31''
 
Steam Query protocol definition - see the [[#a2s 2|a2s]] section below.
{{Feature|informative|Before {{GVI|armaR|0.9.9|size= 0.75}}, a2s settings were:
* {{hl|a2sQueryEnabled}} - bool value, default: false
* {{hl|steamQueryPort}} - number value, range 1..65535, default: 17777
}}
 
 
"a2s": {
"address": "198.51.100.42",
"port": 17777
},
 
===== game =====
Define the server's settings - see the [[#game 2|game]] section below.
{{Feature|important|Only '''one''' scenario can be defined - {{armaR}} does '''not''' allow for mission rotation as of v0.9.8.}}
 
{{ArgTitle|5|operating|{{GVI|armaR|0.9.7}}}}
Define various server settings - see the {{Link|#operating 2|operating}} section below.
 
{{ArgTitle|4|a2s|{{GVI|armaR|0.9.9}}}}
''0.9.9.31''
 
===== address =====
required
 
IP address to which A2S socket will be bound. It can be used to restrict A2S queries to a particular network interface.
 
===== port =====
number value, range 1..65535, default: 17777
 
Change Steam Query UDP port on which game listens to A2S requests
 
==== game ====
===== name =====
length 0..100 characters
 
===== password =====
length 0..x characters
 
Password required to join the server.
 
{{ArgTitle|5|passwordAdmin|{{GVI|armaR|0.9.9}}}}
length: 0..x characters
 
Defines the server's admin password, allows a server administrator to login and control the server, to access this either open the chat input box by pressing {{Controls|C}} in the lobby or {{Controls|enter}} in-game followed by: {{hl|#login [the admin password]}}
{{Feature|informative|'''0.9.9''' will move this setting from {{Link|#Configuration File}}/{{Link|#passwordAdmin}}.}}
 
 
{{ArgTitle|5|admins|{{GVI|armaR|0.9.9}}}}
''0.9.9.31''
 
array value of identityIds and/or steamIds
 
List players as server admins - they can be checked in script using <enforce inline>BackendApi.IsListedServerAdmin(int playerId)</enforce> regardless of their logged-in state.
 
In a next version this will allow listed users to {{hl|#login}} without a password.<br>
 
===== scenarioId =====
The scenario's {{hl|.conf}} file path is defined here.
See the [[Arma Reforger:Startup Parameters#listScenarios|listScenarios]] startup parameter to list available scenarios and obtain their {{hl|.conf}} file path.
 
===== playerCountLimit =====
{{ArgTitle|6|maxPlayers|{{GVI|armaR|0.9.9|size= 0.75}}}}
number value, range 1..256, default: 64
 
Set the maximum amount of players on the server.
 
===== visible =====
bool value, default: true (since 0.9.8.73)
 
Set the visibility of the server in the Server Browser.
 
{{ArgTitle|5|crossPlatform|{{GVI|armaR|0.9.9}}}}
bool value, default: false
 
If set to true, automatically adds {{hl|"PLATFORM_PC"}} and {{hl|"PLATFORM_XBL"}} to {{Link|#supportedGameClientTypes}} if they are missing; does nothing if set to false.
 
===== supportedGameClientTypes =====
{{ArgTitle|6|supportedPlatforms|{{GVI|armaR|0.9.9|size= 0.75}}}}
array value, default: ["PLATFORM_PC"]
 
Define the platforms which the server accepts, allowing crossplay.
{{Feature|informative|A server cannot be Xbox-exclusive; if configured with only {{hl|PLATFORM_XBL}}, the server will not start.}}
 
Possible values:
 
{| class="wikitable"
! Key
! Value
|-
| PLATFORM_PC
| PC
|-
| PLATFORM_XBL
| Xbox console
|}
 
===== gameProperties =====
Define the scenario's settings - see the [[#gameProperties 2|gameProperties]] section below.
 
===== mods =====
The list of mods required by the client. They will automatically be downloaded and activated on join.
 
====== modID ======
GUID of the mod. It can be obtained from i.e. Workbench options when mod is running or directly from gproj file
 
[[Image:armareforger-server-hosting-guid.png|1200px]]
 
====== name ======
This parameter doesn't do anything and is only used as sort of comment, with human readable name of the mod.
 
====== version ======
{{Feature|informative|The {{hl|version}} mod parameter is optional. If it missing, the latest mod version will be used.}}
 
==== gameProperties ====
===== serverMaxViewDistance =====
number value, range 500..10000, default: 1600
 
===== serverMinGrassDistance =====
number value, range 0 / 50..150, default: 0
 
Minimum grass distance in meters. If set to 0 no distance is forced upon clients.
 
===== fastValidation =====
bool value, default: true (since 0.9.6)
 
Validation of map entities and components loaded on client when it joins, ensuring things match with initial server state.
* true (enabled) - minimum information required to make sure data matches is exchanged between client. When a mismatch occurs, no additional information will be available for determining where client and server states start to differ.<!--
--> All servers that expect clients to connect over internet should have fast validation enabled.
* false (disabled) - extra data for every replicated entity and component in the map will be transferred when new client connects to the server.<!--
--> When a mismatch occurs, it is possible to point at particular entity or component where things start to differ.<!--
--> When developing locally (ie. both server and client run on the same machine), it is fine to disable fast validation to more easily pin point source of the problem.
 
{{Feature|warning|'''Always''' set this value to {{hl|true}} for a public server!}}
 
===== networkViewDistance =====
number value, range 500.5000, default: 1500
 
Maximum network streaming range of replicated entities.
 
===== battlEye =====
bool value, default: true (since 0.9.8.73)
 
true to enable BattlEye, false to disable it.
 
===== disableThirdPerson =====
bool value, default: false
 
Force clients to use the first-person view.
 
===== VONDisableUI =====
bool value, default: false
 
Force clients to not have VON (Voice Over Network) UI.
 
===== VONDisableDirectSpeechUI =====
bool value, default: false
 
Force clients to not have VON (Voice Over Network) Direct Speech UI.
 
==== missionHeader ====
This property overwrites the scenario's {{Link/Enfusion|armaR|SCR_MissionHeaderCampaign}}.
 
{{ArgTitle|4|operating|{{GVI|armaR|0.9.7}}}}
 
===== lobbyPlayerSynchronise =====
bool value, default: true (since 0.9.8.73)
 
If enabled, the list of player identities present on server is sent to the GameAPI along with the server's heartbeat.
{{Feature|informative|This setting fixes the discrepancy between the real and reported number of players on the server.}}
<!--
{{ArgTitle|5|disableCrashReporter|{{GVI|armaR|0.9.8}}}}
bool value, default: false
 
If enabled, the automatic server-side [[Arma Reforger:Crash Report|Crash Report]] is disabled. Has the same effect as {{Link|Arma Reforger:Startup Parameters#disableCrashReporter|-disableCrashReporter}}.
 
{{ArgTitle|5|disableServerShutdown|{{GVI|armaR|0.9.8}}}}
bool value, default: false
 
If enabled, the server will not automatically shutdown if connection to backend is lost.
Related to room requests errors - other causes like corrupted config will still shutdown the server.
-->
{{ArgTitle|5|playerSaveTime|{{GVI|armaR|0.9.8}}}}
number value, default: 120
 
Default period in seconds for saving players for both Online and Local storage (player save can still be requested on demand).
 
{{ArgTitle|5|aiLimit|{{GVI|armaR|0.9.8}}}}
''0.9.8.64''
 
number value, default: -1
 
Sets the top limit of AIs. No system will be able to spawn any AIs when this ceiling is reached (through <enforce inline>aiWorld.CanAICharacterBeAdded()</enforce>)
 
A negative number is not considered as valid value and is then ignored - limit is not applied.
 
This param is overridden by the {{Link|Arma Reforger:Startup Parameters#AILimit|-aiLimit}} startup parameter.
 
{{ArgTitle|5|slotReservationTimeout|{{GVI|armaR|0.9.9}}}}
''0.9.9.31''
 
number value, range 5..300, default 60
 
Sets the duration (in seconds) for how long will the backend and server reserve a slot for kicked player.
It is considered disabled when set to the minimal value, the value being the same as for a normal disconnect.
 
It can be used in scripts ''via'' Game Mode events:
<enforce>
OnPlayerAuditTimeouted(int iPlayerID) // invoked when player did not reconnect in time
OnPlayerAuditRevived(int iPlayerID) // invoked when player successfully reconnected in time
</enforce>
 
{{Feature|informative|Reservation works only for '''replication''' kicks.}}
 
==== Template ====
<syntaxhighlight lang="json">
{
"gameHostBindAddress": "",
"gameHostBindPort": 0,
"gameHostRegisterBindAddress": "",
"gameHostRegisterPort": 0,
"game": {
"name": "",
"password": "",
"scenarioId": "",
"playerCountLimit": 0,
"visible": true,
"gameProperties": {
"serverMaxViewDistance": 0,
"serverMinGrassDistance": 0,
"networkViewDistance": 0,
"disableThirdPerson": false,
"fastValidation": true,
"battlEye": true,
"VONDisableUI": false,
"VONDisableDirectSpeechUI": false
},
"mods": []
}
}
</syntaxhighlight>





Revision as of 22:49, 4 July 2023

Server Hosting is the fact of hosting a game instance accessible over the network to other players. There are two possible modes in Arma Reforger: player-hosted and dedicated.


Dedicated Server

A Dedicated Server is a server without any game instance launched; it purely processes game information and network synchronisation.

Ports

Protocol Port Description
UDP 2001 Game port
UDP 50000..65000 Steam communication ports
UDP 17777 Steam Query protocol used to provide Steam with server status (amount of players, scenario name, etc)

BattlEye

See BattlEye's documentation and FAQ - there is also a BattlEye wiki article.

It is possible to modify BattlEye's RCon port and password by adding the following settings to Arma Reforger\BattlEye\BEServer_x64.cfg:

RConPort 5678
RConPassword myNewBEPassword
When editing Arma Reforger's BattlEye config, make sure to append new settings to it and not erase existing information, otherwise the kick message "Missing GameID/MasterPort server config settings" will welcome (and eject) players.

In the event of the file being already incorrectly edited, verify the game's files on Steam (see Steam's tutorial):

  • right-click on Arma Reforger
  • select "Properties"
  • click on "Local Files"
  • press "Verify integrity of game files"
Steam will now verify and repair modified files. This will not erase any personal files, game progress, controls and other configurations will remain unchanged.

Startup Parameters

See Startup Parameters - Hosting and the Server Config page for more information.

config

The Server exe uses the -config startup parameter to target the configuration file.

ArmaReforgerServer.exe -config ".\Configs\Campaign_SWCoast.json"

In above example, Campaign_SWCoast.json is expected to be locted in Configs folder next to the exe.

maxFPS

As of 0.9.8 it is heavily recommended to use this startup parameter, set to a value in the 60..120 range; otherwise, the server can try to use all the available resources!
ArmaReforgerServer.exe -maxFPS 60

server

This parameter instructs the executable to launch local server and load selected world. When this parameter is used, config is ignored. Server parameter can be combined with addons & addonsDir parameters to start a server with local mods, which can be useful when testing addon before uploading it Workshop.

ArmaReforgerServer.exe -server "worlds/MP/MPTest.ent" -addonsDir "C:\MyModsDir" -addons MyCustomMod

Others

Below Arma Reforger:Startup Parameters are optional but may prove useful upon some cases:

  • logStats - allows to log server's FPS every x milliseconds
  • logLevel - sets the log detail level
  • listScenarios - logs available scenario .conf file paths on startup

Configuration File

See Server Config.


Player-Hosted Server

Also known as Listen Server, a Player-Hosted Server is a server also hosting a local player. Such server is started from within the game, in Multiplayer > Host tab > Host new server.

Settings

The settings are all self-explanatory and Dedicated Server can be used.

Scenario Selection

Scenario and Source are two related fields:

  • Scenario is the list of all available scenarios
  • Source is a read-only field telling from which mod (or Arma Reforger) the selected Scenario is.

Crossplay

This option allows console players to join - see supportedGameClientTypes.

Mods

This tab allows to enable or disable local mods to make them available to the hosted game (or not). The Workshop is accessible from here.


Linux Server

The game server will by default use Docker container's IP for server browser registration and client connection which will cause failure during client connection attempt.
To avoid it use:

  • Run the "ipconfig" command in cmd to list the local IPs
  • "IP Connect" option in the server browser and insert one of the server's local IPs
  • Custom server config (.json file) with "gameHostRegisterBindAddress" and "gameHostRegisterPort" parameters set to one of the local IP:Port combinations

Example:

-config "./My_Config.json"
ClientConnectAddress 192.168.39.98

SteamCMD Setup

This tutorial has been tested on Ubuntu.
  1. Install SteamCMD - for the latest documentation, see https://developer.valvesoftware.com/wiki/SteamCMD
    1. Download and install it (link on the SteamCMD page) - it will auto-update to the latest version
    2. Login as anonymous - type in login anonymous
    3. Set the install path with the force_install_dir command (otherwise the default location will be used, /home/<username>/steam/steamapps/common)
  2. Download and install the server app_update 1874900
  3. Quit SteamCMD quit
To run Arma Reforger's server, run ./ArmaReforgerServer in the installation directory.

Example Script

update_armar_ds.txt

Based on the SteamCMD page's example

// update_armar_ds.txt
//
@ShutdownOnFailedCommand 1
@NoPromptForPassword 1
force_install_dir ../armar_ds
login anonymous
app_update 1874900 validate
quit
Execution
steamcmd +runscript update_armar_ds.txt

Docker Setup

This Docker configuration is adapted to Ubuntu. Other distributions such as Fedora or Arch Linux may store their certificates at the following location: /etc/pki/ca-trust/ - be sure to edit the configuration accordingly.
A community Docker image is available on GitHub: https://github.com/acemod/docker-reforger
  1. Install the latest Docker:
    1. Download and install Docker
    2. Enable Hyper-V in Windows if it is not already
    3. Assign HW resources in Docker/Settings/Resources/Advanced:
      1. CPU: 4 cores
      2. Memory: 6 GB
  2. Download Ubuntu 18.04 image via batch or powershell cmd: docker pull ubuntu:18.04
  3. Run Ubuntu image:
    1. mount volume with server data
    2. expose client connection UDP port
    3. Example: docker container run -t -d -p 2001:2001/udp -v D:\server_data\linux_packed:/home/packed --name ubuntu_test ubuntu:18.04
  4. Connect to bash console: docker exec -it ubuntu_test /bin/bash
  5. Install necessary software:
    1. libcurl4 - required by server app
    2. net-tools - for debug purposes (enables ifconfig etc)
    3. Installation:
      1. apt-get update
      2. apt-get install libcurl4
      3. apt-get install net-tools
      4. apt-get install libssl1.1
  6. Create logs directory, e.g: mkdir /home/profile
  7. Run server:
    1. server executable needs proper execution/access rights:
      1. cd server_root_folder
      2. chmod +x ArmaReforgerServer
    2. Example: ./ArmaReforgerServer -gproj ./addons/data/ArmaReforger.gproj -config Configs/ServerConfig/Campaign.json -backendlog -nothrow -profile /home/profile