Difference between revisions of "Server Hosting"

From Holdfast: Nations At War
Jump to navigation Jump to search
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The following documentation details how to host a public or private game server for [[Holdfast: Nations At War]]. The game offers an anonymous dedicated server for both Linux and Windows.
+
{{DISPLAYTITLE:Server Hosting}}
 +
{{ContentTemplateModernInline
 +
| welcome            = [[File:Forum Logo.png|link=|left|alt=Server Hosting]]
 +
| blurb              = How to host a public or private Holdfast server on Windows or Linux (Steam client, SteamCMD, Docker)
 +
| sections_title    = On this page
 +
| sections_content  =
 +
* [[#Quick Start Guide|Quick Start Guide]]
 +
* [[#Windows|Windows]]
 +
** [[#Obtaining the game files|Obtaining the game files]]
 +
*** [[#Download using Steam Client|Download using Steam Client]]
 +
*** [[#Download using SteamCMD|Download using SteamCMD]]
 +
** [[#Basic Configuration & Starting the Server|Basic Configuration & Starting the Server]]
 +
* [[#Linux|Linux]]
 +
** [[#Docker|Docker]]
 +
** [[#Manual Setup|Manual Setup]]
 +
*** [[#Downloading using SteamCMD|Downloading using SteamCMD]]
 +
*** [[#Basic Configuration & Starting the Server (Linux)|Basic Configuration & Starting the Server (Linux)]]
  
== Quick Start Guide ==
+
| featured_title    = Server Hosting
Quick start guide for local testing:
+
| featured_content  = {{:{{FULLPAGENAME}}/Body}} <!-- everything below lives on /Body -->
 
+
| image_content      =
# Download <code>Holdfast: Nations At War - Dedicated Server</code> from Steam (<code>Tools</code> Section)
+
| layout            = auto
# Change the map rotation file (<code>serverconfig_default.txt</code>) and add mods or change maps.
+
| left_width        = 320px
# Launch the server using the <code>LaunchServer.ps1</code> (Windows) or <code>LaunchServer.sh</code> (Linux) file
+
| aside_width        = 320px
 
+
| gap                = 0.5rem
* In Holdfast's server browser click on "Join Custom Server", then click on the top "Connect" (leave localhost and change the port if required).
+
| show_toc          = no
* If you want other players to be able to connect, you likely have to setup port forwarding on your router and open the ports in your local firewall.
+
| show_section_edit  = yes
Warning: Game updates will overwrite the changes to the <code>LaunchServer</code> script and <code>serverconfig_default.txt</code>. If you want to prevent this, create copies of both files and change the arguments of your custom <code>LaunchServer</code> script to point to your <code>serverconfig</code> file.
+
}}
 
 
==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 <code>Holdfast: Nations at War - Dedicated Server</code> 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 <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>
 
 
 
Once downloading is complete, right click on the list in Steam > Manage > Browse local files.
 
{|style="margin: 0 auto;"
 
| [[File:ServerSteamLocation.png|thumb|Steam Application you need to download]]
 
| [[File:ServerBrowseLocalFiles.png|thumb|Browse local files on Steam client]]
 
|}
 
 
 
====Download using SteamCMD====
 
The '''Steam Console Client''' or [https://developer.valvesoftware.com/wiki/SteamCMD '''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 [https://developer.valvesoftware.com/wiki/SteamCMD '''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 [https://developer.valvesoftware.com/wiki/SteamCMD '''SteamCMD'''] here: https://developer.valvesoftware.com/wiki/SteamCMD#Windows
 
 
 
The files can then be obtain using the following batch command:
 
<pre>
 
$ steamcmd +login [LOGINNAME] [PASSWORD] +force_install_dir "C:\holdfastserver" +app_update 589290 +quit
 
</pre>
 
 
 
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===
 
[[File:FolderStructure.jpg|thumb|Holdfast merged server & game files folder structure]]
 
 
 
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|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:
 
 
 
<pre>
 
serverconfig_default.txt -> serverconfig_newserver.txt
 
serverconfig_default_headless.bat -> serverconfig_newserver_headless.bat
 
</pre>
 
 
 
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:
 
 
 
<pre>
 
### Server & Steam Ports (Both ports must be unique per server instance).
 
server_port 20100
 
steam_query_port 27000
 
</pre>
 
 
 
Notes:
 
: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:
 
<pre>
 
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
 
</pre>
 
 
 
Networking setup (loosely "low / high tick" settings):
 
<pre>
 
# 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
 
</pre>
 
 
 
Edit the ''start_server1_newserver_headless.bat'' to mount your newly created config:
 
<pre>
 
start "New Server" /affinity 3 "vapuriloadtester.exe" -s --serverConfigFilePath "serverconfig_newserver.txt" --outputLog "logs_output\outputlog_newserver.txt" --adminCommandLogFilePath "logs_adminactions\adminactions_newserver.txt" --logArchivesDirectory "logs_archive" --framerate 120 --serverheadless
 
</pre>
 
 
 
You can now launch gameserver by starting the ''start_server1_newserver_headless.bat''.
 
 
 
==Linux==
 
===Docker===
 
If your server is running [https://www.docker.com/ Docker], you can simply use:
 
<pre>
 
docker run -d --net=host --name=holdfastnaw-dedicated cm2network/holdfastnaw
 
</pre>
 
 
 
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):
 
<pre>
 
docker run -d --net=host -e SERVER_PORT=20100 -e STEAM_QUERY_PORT=27000 --name=holdfastnaw-dedicated cm2network/holdfastnaw
 
</pre>
 
 
 
You can find the associated Docker Hub page here:
 
[https://hub.docker.com/r/cm2network/holdfastnaw/ https://hub.docker.com/r/cm2network/holdfastnaw/]
 
 
 
===Manual Setup===
 
 
 
===Obtaining the game files===
 
====Downloading using SteamCMD====
 
The '''Steam Console Client''' or [https://developer.valvesoftware.com/wiki/SteamCMD '''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 [https://developer.valvesoftware.com/wiki/SteamCMD '''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 [https://developer.valvesoftware.com/wiki/SteamCMD '''SteamCMD'''] here: https://developer.valvesoftware.com/wiki/SteamCMD#Linux
 
 
 
The dedicated server can then be obtain using the following bash command:
 
<pre>
 
$ steamcmd.sh \
 
        +login anonymous \
 
        +force_install_dir /opt/holdfastserver \
 
        +app_update 1424230 +quit
 
</pre>
 
 
 
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|Server Configuration]] page to find out more about modifying server configs.
 
 
 
Duplicate the example config using the following command:
 
 
 
<pre>
 
$ cd /opt/holdfastserver
 
$ cp serverconfig_default.txt serverconfig_myserver.txt
 
</pre>
 
 
 
'''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:
 
 
 
<pre>
 
### Server & Steam Ports (Both ports must be unique per server instance).
 
server_port 20100
 
steam_query_port 27000
 
</pre>
 
 
 
Notes:
 
:Make sure to open the appropriate firewall ports for UDP!
 
:Holdfast gameservers 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:
 
<pre>
 
server_name My Server
 
server_region europe #
 
server_admin_password defaultAdminPWReplace
 
#server_password mypassword
 
</pre>
 
 
 
Networking setup (loosely "server tick" settings):
 
<pre>
 
# 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
 
</pre>
 
 
 
You can then start the server using the following commands:
 
 
 
<pre>
 
# 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"
 
</pre>
 

Latest revision as of 09:27, 19 September 2025


Server Hosting

How to host a public or private Holdfast server on Windows or Linux (Steam client, SteamCMD, Docker)

Navigation menu