Difference between revisions of "Server Hosting"
Line 5: | Line 5: | ||
# Download "Holdfast: Nations At War - Dedicated Server" from Steam ("Tools" Section) | # Download "Holdfast: Nations At War - Dedicated Server" from Steam ("Tools" Section) | ||
− | # Change the map rotation file and add the mod, change maps. | + | # Change the map rotation file and add the mod, change maps in "serverconfig_default.txt". Note: This file will get overwritten by updates to the server! If you want to keep it, duplicate it and change the server config file path in the .bat file |
# Launch the server using the ".ps" file | # Launch the server using the ".ps" file | ||
Line 17: | Line 17: | ||
To get started, navigate to your Steam library in the Steam Client. | To get started, navigate to your Steam library in the Steam Client. | ||
− | Select either Tools in the drop down list, or simply search <code>holdfast</code> into the search box, and you will be presented with three options. | + | |
+ | Select either Tools in the drop down list, or simply search <code>holdfast</code> into the search box (you might need to Tick "Tools" at the top of the list for the dedicated server to become visible), and you will be presented with three options. | ||
+ | |||
Download the application named <code>Holdfast: Nations at War - Dedicated Server</code> | Download the application named <code>Holdfast: Nations at War - Dedicated Server</code> | ||
+ | |||
Once downloading is complete, right click on the list in Steam > Manage > Browse local files. | Once downloading is complete, right click on the list in Steam > Manage > Browse local files. | ||
{|style="margin: 0 auto;" | {|style="margin: 0 auto;" | ||
Line 60: | Line 63: | ||
Notes: | Notes: | ||
:Make sure to open the appropriate firewall ports for UDP! | :Make sure to open the appropriate firewall ports for UDP! | ||
− | : | + | :Holdfast game servers respond, when correctly configured, to [https://developer.valvesoftware.com/wiki/Server_queries A2S Queries] on the ''steam_query_port''. Returning map, player count and player information when requested. |
Basic trivial variables: | Basic trivial variables: | ||
Line 74: | Line 77: | ||
<pre> | <pre> | ||
# LowLatency = Reduced packet rate on close-range (high player count) | # LowLatency = Reduced packet rate on close-range (high player count) | ||
+ | # Balanced = Balanced packet rate on close-range (medium-high player count) | ||
# HighAccuracy = Increased packet rate on close-range (low player count) | # HighAccuracy = Increased packet rate on close-range (low player count) | ||
− | network_broadcast_mode | + | # Realtime = Increased packet rate on close-range (very low player count / competitive setting) |
+ | # UltraHighAccuracy = Even higher packet rate | ||
+ | network_broadcast_mode Balanced | ||
</pre> | </pre> | ||
Line 177: | Line 183: | ||
# HighAccuracy = Increased packet rate on close-range (low player count) | # HighAccuracy = Increased packet rate on close-range (low player count) | ||
# Realtime = Increased packet rate on close-range (very low player count / competitive setting) | # Realtime = Increased packet rate on close-range (very low player count / competitive setting) | ||
+ | # UltraHighAccuracy = Even higher packet rate | ||
network_broadcast_mode Balanced | network_broadcast_mode Balanced | ||
</pre> | </pre> |
Revision as of 14:35, 6 December 2022
The following documentation details how to host a public or private gameserver for Holdfast: Nations At War. The game offers an anonymous dedicated server for both Linux and Windows.
Quick Start Guide
Quick start guide for local testing:
- Download "Holdfast: Nations At War - Dedicated Server" from Steam ("Tools" Section)
- Change the map rotation file and add the mod, change maps in "serverconfig_default.txt". Note: This file will get overwritten by updates to the server! If you want to keep it, duplicate it and change the server config file path in the .bat file
- Launch the server using the ".ps" file
- In Holdfast's server browser click on "Join Custom Server", then click on the top "Connect" (leave localhost and change the port if required).
- If you want other players to be able to connect, you likely have to setup port forwarding.
Windows
Obtaining the game files
Download using Steam Client
The easiest way to get access to server files would be to download though Steam, using the Holdfast: Nations at War - Dedicated Server
app that will be in your Steam library.
To get started, navigate to your Steam library in the Steam Client.
Select either Tools in the drop down list, or simply search holdfast
into the search box (you might need to Tick "Tools" at the top of the list for the dedicated server to become visible), and you will be presented with three options.
Download the application named Holdfast: Nations at War - Dedicated Server
Once downloading is complete, right click on the list in Steam > Manage > Browse local files.
Download using SteamCMD
The Steam Console Client or SteamCMD is a command-line version of the Steam client. Its primary use is to install and update various dedicated servers available on Steam using a command-line interface. It works with games that use the SteamPipe content system. All games have been migrated from the deprecated HLDSUpdateTool to SteamCMD. This is usually required if you are forced to use a terminal for your server setup. You can find instructions on how to download SteamCMD here: https://developer.valvesoftware.com/wiki/SteamCMD#Windows
The files can then be obtain using the following batch command:
$ steamcmd +login [LOGINNAME] [PASSWORD] +force_install_dir "C:\holdfastserver" +app_update 589290 +quit
Notes:
- +anonymous will fail because the account requires to own a copy of the game to download the game files!
- You might need to enter a 2-Factor Auth Code during this step.
- In case the server ever stops working you can run the command with +app_update 589290 validate to verify the game files.
Basic Configuration & Starting the Server
The server files come with a selection of example server configs that show off how to setup various maps and game modes. Consult the Server Configuration page to find out more about modifying the server config.
Duplicate one of the example configs and one of the server .bats, for example:
serverconfig_server1_armybattlefield.txt -> serverconfig_server1_newserver.txt start_server1_armybattlefield_headless.bat -> start_server1_newserver_headless.bat
This will make sure that if you ever have to reapply the server files, the server config will not be overwritten. Open the new config file using your favorite Notepad or Notepad++ and configure the basic server settings:
### Server & Steam Ports (Both ports must be unique per server instance). server_port 20100 steam_query_port 27000
Notes:
- Make sure to open the appropriate firewall ports for UDP!
- Holdfast game servers respond, when correctly configured, to A2S Queries on the steam_query_port. Returning map, player count and player information when requested.
Basic trivial variables:
server_name New Server - Army Battlefield server_welcome_message Welcome to my new game server! server_region europe server_admin_password ChangeThisPassword #server_password ChangeThisPassword
Networking setup (loosely "low / high tick" settings):
# LowLatency = Reduced packet rate on close-range (high player count) # Balanced = Balanced packet rate on close-range (medium-high player count) # HighAccuracy = Increased packet rate on close-range (low player count) # Realtime = Increased packet rate on close-range (very low player count / competitive setting) # UltraHighAccuracy = Even higher packet rate network_broadcast_mode Balanced
Edit the start_server1_newserver_headless.bat to mount your newly created config:
start "New Server" /affinity 3 "vapuriloadtester.exe" -s --serverConfigFilePath "serverconfig_server1_newserver.txt" --outputLog "logs_output\outputlog_server1_newserver.txt" --adminCommandLogFilePath "logs_adminactions\adminactions_server1_newserver.txt" --logArchivesDirectory "logs_archive" --framerate 120 --serverheadless
You can now launch gameserver by starting the start_server1_newserver_headless.bat.
Linux
Docker
If your server is running Docker, you can simply use:
docker run -d --net=host --name=holdfastnaw-dedicated cm2network/holdfastnaw
The container will automatically update the game on startup, so if there is a game update just restart the container.
The config is located here: /home/steam/holdfastnaw-dedicated/
If you want to launch another instance you can increment the environment variables, using -e (--env):
docker run -d --net=host -e SERVER_PORT=20100 -e STEAM_QUERY_PORT=27000 --name=holdfastnaw-dedicated cm2network/holdfastnaw
You can find the associated Docker Hub page here: https://hub.docker.com/r/cm2network/holdfastnaw/
Manual Setup
Download Requirements
Ubuntu & Debian
Install requirements:
$ apt-get update \ && apt-get install -y \ libsqlite3-0 \ wget \ ca-certificates
If you want to perform a cleanup run the following command (recommended if run inside of container):
$ apt-get clean autoclean \ && apt-get autoremove -y \ && rm -rf /var/lib/apt/lists/*
Obtaining the game files
Downloading using SteamCMD
The Steam Console Client or SteamCMD is a command-line version of the Steam client. Its primary use is to install and update various dedicated servers available on Steam using a command-line interface. It works with games that use the SteamPipe content system. All games have been migrated from the deprecated HLDSUpdateTool to SteamCMD. This is usually required if you are forced to use a terminal for your server setup. You can find instructions on how to download SteamCMD here: https://developer.valvesoftware.com/wiki/SteamCMD#Linux
The dedicated server can then be obtain using the following bash command:
$ steamcmd.sh \ +login anonymous \ +force_install_dir /opt/holdfastserver \ +app_update 1424230 +quit
Notes:
- In case the server ever stops working you can run the command with +app_update 1424230 validate to verify the game files.
Basic Configuration & Starting the Server
The dedicated server comes with an example server config that shows off how to setup a basic game server. Consult the Server Configuration page to find out more about modifying server configs.
Duplicate the example config using the following command:
$ cd /opt/holdfastserver $ cp serverconfig_default.txt serverconfig_myserver.txt
It's strongly advised to duplicate the "serverconfig_default.txt" as a game update or validate might overwrite the file.
Open the new config file using your favorite vim, nano or emacs and configure the basic server settings:
### Server & Steam Ports (Both ports must be unique per server instance). server_port 20100 steam_query_port 27000
Notes:
- Make sure to open the appropriate firewall ports for UDP!
- Holdfast gameservers respond, when correctly configured, to A2S Queries on the steam_query_port. Returning map, player count and player information when requested.
Basic trivial variables:
server_name My Server server_region europe # server_admin_password defaultAdminPWReplace #server_password mypassword
Networking setup (loosely "server tick" settings):
# LowLatency = Reduced packet rate on close-range (high player count) # Balanced = Balanced packet rate on close-range (medium-high player count) # HighAccuracy = Increased packet rate on close-range (low player count) # Realtime = Increased packet rate on close-range (very low player count / competitive setting) # UltraHighAccuracy = Even higher packet rate network_broadcast_mode Balanced
You can then start the server using the following commands:
# Start holdfast server "./Holdfast NaW" -startserver \ -batchmode \ -nographics \ -screen-width 640 \ -screen-height 480 \ -screen-quality "Fastest" \ -framerate "120" \ --serverheadless \ -serverConfigFilePath "serverconfig_myserver.txt" \ -logFile "logs_output/outputlog_server.txt" \ -logArchivesDirectory "logs_archive/" \ -p "20100"