Server Hosting – Arma Reforger

From Bohemia Interactive Community
Jump to navigation Jump to search
(Page creation)
 
m (Some wiki formatting)
 
(68 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{TOC|side}}
{{TOC|side}}
Server Hosting is the fact of hosting a game instance accessible over the network to other players.
Server Hosting is the fact of hosting a game instance accessible over the network to other players.
<!--
There are two possible modes in {{armaR}}: '''player-hosted''' and '''dedicated'''.
There are two possible modes in {{armaR}}: '''player-hosted''' and '''dedicated'''.
-->




== Player-Hosted Server ==
== Dedicated Server ==


Also known as '''Listen Server''', a '''Player-Hosted Server''' is a server with a local client that plays on it too.
A '''Dedicated Server''' is a server without any game instance launched; it purely processes game information and network synchronisation.
<!-- Such server can be started from within the game, in {{hl|Play > Host}} -->
{{Feature|important|{{armaR}} does not allow for Player-Hosted Server as of v0.9.5.}}


=== BattlEye ===


== Dedicated Server ==
{{Feature|informative|See {{Link|http://www.battleye.com/|BattlEye}}'s {{Link|https://www.battleye.com/support/documentation/|documentation}} and {{Link|https://www.battleye.com/support/faq/|FAQ}} - there is also a [[BattlEye]] wiki article.}}


A '''Dedicated Server''' is a server without any game instance launched; it purely processes game information and network synchronisation.
It is possible to modify BattlEye's RCon port and password by '''adding''' the following settings to {{hl|Arma Reforger\BattlEye\BEServer_x64.cfg}}:


=== Ports ===
RConPort 5678
RConPassword myNewBEPassword


{| class="wikitable"
{{Feature|warning|
! Protocol
When editing {{armaR}}'s BattlEye config, make sure to '''append''' new settings to it and not ''erase'' or even ''edit'' existing information.<br>
! Port
Missing information will have the kick message "Missing GameID/MasterPort server config settings" welcome (and eject) players, whereas modified values will prevent BattlEye from working.<br>
! Description
In the event of the file being already incorrectly edited, verify the game's files on {{Link|https://steampowered.com/|Steam}} (see {{Link|https://help.steampowered.com/en/faqs/view/0C48-FCBD-DA71-93EB|Steam's tutorial}}):
|-
* delete {{hl|BEServer_x64.cfg}}
| UDP
* in Steam, right-click on {{armaR}}
| 2001
* select "Properties"
| Game port
* click on "Local Files"
|-
* press "Verify integrity of game files"
| UDP
Steam will now verify and repair modified files. This will not erase any personal files, game progress, controls and other configurations will remain unchanged.
| 50000..65000
}}
| Steam communication ports
|-
| UDP
| 17777
| Steam Query protocol used to provide Steam with server status (amount of players, scenario name, etc)
|}


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


==== config ====
==== config ====
The Server exe uses the {{hl|-config}} [[Arma Reforger:Startup Parameters|startup parameter]] to target the configuration file.
The Server exe uses the {{hl|-config}} {{Link|Arma Reforger:Startup Parameters|startup parameter}} to target the configuration file.
As of 0.9.5 it can only load json files from relative {{hl|/Configs/}} directory.
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.


  ArmaReforgerServer.exe -config "Configs\Campaign_SWCoast.json"
==== maxFPS ====
See {{HashLink|Arma Reforger:Startup Parameters#Hosting}} and the {{HashLink|#Configuration}} section below for more information example.
{{Feature|warning|As of '''0.9.8''' it is '''heavily recommended''' to use {{Link|Arma Reforger:Startup Parameters#maxFPS|this}} {{Link|Arma Reforger:Startup Parameters|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 {{Link|Arma Reforger:Startup Parameters#addons|addons}} and {{Link|Arma Reforger:Startup Parameters#addonsDir|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 ====
==== Others ====
Below [[Arma Reforger:Startup Parameters]] are optional but may prove useful upon some cases:
The below {{Link|Arma Reforger:Startup Parameters}} are optional but may prove useful upon some cases:
* [[Arma Reforger:Startup Parameters#logFPS|logFPS]] - allows to log server's FPS every x milliseconds
* {{Link|Arma Reforger:Startup Parameters#logStats|logStats}} - allows to log server's FPS every x milliseconds
* [[Arma Reforger:Startup Parameters#logLevel|logLevel]] - sets the log detail level
* {{Link|Arma Reforger:Startup Parameters#logLevel|logLevel}} - sets the log detail level
* [[Arma Reforger:Startup Parameters#maxFPS|maxFPS]] - sets a maximum FPS limit for the server - saving performance in some cases
* {{Link|Arma Reforger:Startup Parameters#listScenarios|listScenarios}} - logs available scenario {{hl|.conf}} file paths on startup
* [[Arma Reforger:Startup Parameters#listScenarios|listScenarios]] - logs available scenario {{|.conf}} file paths on startup


=== Configuration File ===
=== Configuration File ===


{{armaR}} uses JSON configuration format to run. A configuration file looks like this:
See {{Link|Arma Reforger:Server Config}}.


<syntaxhighlight lang="json">
{
"dedicatedServerId": "",
"region": "EU",
"gameHostBindAddress": "",
"gameHostBindPort": 2001,
"gameHostRegisterBindAddress": "",
"gameHostRegisterPort": 2001,
"game": {
"name": "Server Name - Mission Name",
"password": "",
"scenarioId": "{ECC61978EDCC2B5A}Missions/23_Campaign.conf",
"playerCountLimit": 32,
"autoJoinable": false,
"visible": true,
"gameProperties": {
"serverMaxViewDistance": 2500,
"serverMinGrassDistance": 50,
"networkViewDistance": 1000,
"disableThirdPerson": true,
"fastValidation: true,
"battlEye": true,
"missionHeader": {
"m_iPlayerCount": 40,
"m_eEditableGameFlags": 6,
"m_eDefaultGameFlags": 6,
"other": "values"
}
},
"mods": [
{
"modId": "abcd3995-b1d9-473d-aa11-0836c0a595ad",
"name": "WeaponSwitching",
"version": "1.0.1"
},
{
"modId": "efgh3995-b1d9-473d-aa11-0836c0a595ad",
"name": "Explosive Goats beta",
"version": "0.5.42"
}
]
}
}
</syntaxhighlight>


Values are strings, unless mentioned otherwise.
{{ArgTitle|2|Player-Hosted Server|{{GVI|armaR|0.9.7}}}}


===== dedicatedServerId =====
Also known as '''Listen Server''', a '''Player-Hosted Server''' is a server also hosting a local player.
Used by the "Favourite" system. If not provided, the backend will provide a new ID and save it to the config file. It is recommended to server administrators to store this ID safe to ensure to keep their playerbase in case of a server migration or a config accident.
Such server is started from within the game, in {{hl|Multiplayer > Host tab > Host new server}}.


{{{!}} class="wikitable sortable" style="float: right; margin: 0 0 0.5em 1.5em"
=== Settings ===
{{!}}+ Common {{Wikipedia|ISO 3166-1 alpha-2}} values:
! Country
! Code
{{!}}-
{{!}} USA
{{!}} US
{{!}}-
{{!}} DE
{{!}} Germany
{{!}}-
{{!}} CN
{{!}} China
{{!}}-
{{!}} CZ
{{!}} Czech Republic
{{!}}-
{{!}} FR
{{!}} France
{{!}}-
{{!}} GB
{{!}} United Kingdom of Great Britain and Northern Ireland
{{!}}-
{{!}} RU
{{!}} Russian Federation
{{!}}-
{{!}} JP
{{!}} Japan
{{!}}-
{{!}} AU
{{!}} Australia
{{!}}}
===== region =====
ID / name of region - it is needed when the server registers the launched game in the Lobby. {{Wikipedia|ISO 3166-1 alpha-2}} code can be used in this field.
Usual Nitrado values:
* "EU-FFM"
* "US-LA"
* "US-MI"


===== gameHostBindAddress =====
The settings are all self-explanatory and {{Link|#Dedicated Server}} can be used.
IP for client connection.
{{Feature|important|IP'''v6''' is '''not''' supported by {{armaR}} v0.9.5.}}


===== gameHostBindPort =====
==== Scenario Selection ====
number value, range 1..65535, default: 2001
'''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 {{armaR}}) the selected Scenario is.


===== gameHostRegisterBindAddress =====
==== Crossplay ====
IP for backend registration
This option allows console players to join - see {{Link|#supportedGameClientTypes}}.
{{Feature|important|IP'''v6''' is '''not''' supported by {{armaR}} v0.9.5.}}


===== gameHostRegisterPort =====
=== Mods ===
number value, range 1..65535, default: 2001


Port for backend registration
This tab allows to enable or disable local mods to make them available to the hosted game (or not). The {{Link|Arma Reforger:Workshop}} is accessible from here.


===== 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.5.}}


==== game ====
== Linux Server ==


===== name =====
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.<br>
length 0..100 characters
To avoid it use:
 
* Run the "ipconfig" command in cmd to list the local IPs
===== password =====
* "IP Connect" option in the server browser and insert one of the server's local IPs
length 0..x characters
* Custom server config (.json file) with "gameHostRegisterBindAddress" and "gameHostRegisterPort" parameters set to one of the local IP:Port combinations
 
Example:
Password required to join the server.
-config "./My_Config.json"
 
ClientConnectAddress 192.168.39.98
===== 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.


===== gameNumber =====
=== SteamCMD Setup ===
number value, range 1..9999


Add a suffix to the server's name, if more servers hosted by script (typically in data centers) - e.g "Server Name - 56"
{{Feature|important|This tutorial has been tested on '''Ubuntu'''.}}


===== playerCountLimit =====
# Install SteamCMD - for the latest documentation, see {{Link|https://developer.valvesoftware.com/wiki/SteamCMD}}
number value, range 1..256, default: 127
## Download and install it (link on the {{Link|https://developer.valvesoftware.com/wiki/SteamCMD|SteamCMD}} page) - it will auto-update to the latest version
## Login as anonymous - type in {{hl|login anonymous}}
## Set the install path with the {{hl|force_install_dir}} command (otherwise the default location will be used, {{hl|/home/<username>/steam/steamapps/common}})
# Download and install the server {{hl|app_update 1874900}}
# Quit SteamCMD {{hl|quit}}


Set the maximum amount of players on the server.
{{Feature|informative|To run {{armaR}}'s server, run {{hl|./ArmaReforgerServer}} in the installation directory.}}


===== autojoinable =====
==== Example Script ====
bool value, default: false
; update_armar_ds.txt
 
Based on the {{Link|https://developer.valvesoftware.com/wiki/SteamCMD|SteamCMD}} page's example
Set if the session can be selected through the auto join feature.
<syntaxhighlight lang="bash">
 
// update_armar_ds.txt
===== visible =====
//
bool value, default: true
@ShutdownOnFailedCommand 1
 
@NoPromptForPassword 1
Set the visibility of the server in the Server Browser.
force_install_dir ../armar_ds
 
login anonymous
===== gameProperties =====
app_update 1874900 validate
Define the scenario's settings - see the [[#gameProperties 2|gameProperties]] section below.
quit
 
===== mods =====
The list of mods required by the client. They will automatically be downloaded and activated on join.
 
==== 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.
 
===== networkViewDistance =====
number value, range 500.5000, default: 500
 
Maximum network streaming range of replicated entities.
 
===== battlEye =====
bool value
 
true to enable BattlEye, false to disable it.
 
===== disableThirdPerson =====
bool value, default: false
 
Force clients to use the first-person view.
 
==== missionHeader ====
This property overwrites the scenario's {{hl|[enfusion://ResourceManager/~ArmaReforger:scripts/Game/Mission/SCR_MissionHeaderCampaign.c SCR_MissionHeaderCampaign]}}.
 
==== Template ====
<syntaxhighlight lang="json">
{
"dedicatedServerId": "",
"region": "",
"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
},
"mods": []
}
}
</syntaxhighlight>
</syntaxhighlight>


; Execution
<syntaxhighlight lang="bash">steamcmd +runscript update_armar_ds.txt</syntaxhighlight>


== Linux Setup ==
=== Docker Setup ===


{{Feature|informative|
{{Feature|important|This Docker configuration is adapted to '''Ubuntu'''. Other distributions such as Fedora or Arch Linux may store their certificates at the following location: {{hl|/etc/pki/ca-trust/}} - be sure to edit the configuration accordingly.}}
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.<br>
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:
<pre>
-config "./My_Config.json"
ClientConnectAddress 192.168.39.98
</pre>
}}


=== Docker ===
{{Feature|informative|A community Docker image is available on GitHub: https://github.com/acemod/docker-reforger}}


# Install latest Docker [https://docs.docker.com/desktop/windows/install/ download link]
# Install the latest Docker:
## {{Link|https://docs.docker.com/desktop/windows/install/|Download}} and install Docker
## [https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v Enable Hyper-V in Windows] if it is not already
## [https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v Enable Hyper-V in Windows] if it is not already
## Assign HW resources in {{hl|Docker/Settings/Resources/Advanced}}:
## Assign HW resources in {{hl|Docker/Settings/Resources/Advanced}}:
### CPU: 4 cores
### CPU: 4 cores
### Memory: 6 GB
### Memory: 6 GB
# Download Ubuntu 18.04 image ''via'' batch or powershell cmd: {{ic|docker pull ubuntu:18.04}}
# Download Ubuntu 18.04 image ''via'' batch or powershell cmd: {{hl|docker pull ubuntu:18.04}}
# Run Ubuntu image
# Run Ubuntu image:
## mount volume with server data
## mount volume with server data
## expose client connection UDP port
## expose client connection UDP port
## Example: {{ic|docker container run -t -d -p 2001:2001/udp -v D:\server_data\linux_packed:/home/packed --name ubuntu_test ubuntu:18.04}}
## Example: {{hl|docker container run -t -d -p 2001:2001/udp -v D:\server_data\linux_packed:/home/packed --name ubuntu_test ubuntu:18.04}}
# Connect to bash console: {{ic|docker exec -it ubuntu_test /bin/bash}}
# Connect to bash console: {{hl|docker exec -it ubuntu_test /bin/bash}}
# Install necessary SW
# Install necessary software:
## libcurl4 - required by server app
## libcurl4 - required by server app
## net-tools - for debug purposes (enables ifconfig etc)
## net-tools - for debug purposes (enables ifconfig etc)
Line 299: Line 146:
### apt-get install net-tools
### apt-get install net-tools
### apt-get install libssl1.1
### apt-get install libssl1.1
# Create folder for logs, e.g: {{ic|mkdir /home/profile}}
# Create logs directory, e.g: {{hl|mkdir /home/profile}}
# Set {{hl|TRACY_NO_INVARIANT_CHECK}} environment variable to 1 in order to avoid Tracy Profiler initialization failure: {{ic|export TRACY_NO_INVARIANT_CHECK{{=}}1}}
# Run server:
# Run server
## server executable needs proper execution/access rights:
## server executable needs proper execution/access rights:
### cd server_root_folder
### cd server_root_folder
### chmod +x ArmaReforgerServer_Internal
### chmod +x ArmaReforgerServer
## Example: {{ic|./ArmaReforgerServer_Internal -gproj ./addons/data/ArmaReforger.gproj -config Configs/ServerConfig/Campaign.json -backendlog -nothrow -profile /home/profile}}
## Example: {{hl|./ArmaReforgerServer -gproj ./addons/data/ArmaReforger.gproj -config Configs/ServerConfig/Campaign.json -backendlog -nothrow -profile /home/profile}}




{{GameCategory|armaR|Support}}
{{GameCategory|armaR|Support}}

Latest revision as of 01:36, 2 December 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.

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 or even edit existing information.

Missing information will have the kick message "Missing GameID/MasterPort server config settings" welcome (and eject) players, whereas modified values will prevent BattlEye from working.
In the event of the file being already incorrectly edited, verify the game's files on Steam (see Steam's tutorial):

  • delete BEServer_x64.cfg
  • in Steam, 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 and 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

The below 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