Mordhau Wiki
Sormus (talk | contribs)
Tag: Visual edit
Eios29 (talk | contribs)
Line 127: Line 127:
 
Download SteamCMD for Windows: https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip
 
Download SteamCMD for Windows: https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip
   
===Installing via Steam tools===
+
=== Installing via Steam tools ===
   
  +
1. With Steam open right click on your library and open up "tools"
1. Once you have the server files navigate to location below or wherever you chose to install the server files to.
 
   
<code>"C:\Program Files\Steam\steamapps\common\Mordhau Dedicated Server"</code>
+
2. Navigate to "MORDHAU Dedicated Server" and click install
   
 
3. Once you have the server files navigate to location below or wherever you chose to install the server files to.
2.Create a shortcut of "MordhauServer.exe"
 
 
<blockquote><code>"C:\Program Files\Steam\steamapps\common\Mordhau Dedicated Server"</code></blockquote>
 
4.Create a shortcut of "MordhauServer.exe"
   
3. Right click your new shortcut and select properties
+
5. Right click your new shortcut and select properties
   
4. Edit the target field and add -log to the end of it so a console window is displayed upon launch.
+
6. Edit the target field and add -log to the end of it so a console window is displayed upon launch.
  +
  +
<blockquote><code>"C:\Program Files\Steam\steamapps\common\Mordhau Dedicated Server\MordhauServer.exe" -log</code></blockquote>
   
<code>"C:\Program Files\Steam\steamapps\common\Mordhau Dedicated Server\MordhauServer.exe" -log</code>
 
   
 
You will have to run the server once before it generates configuration files for you to edit.
 
You will have to run the server once before it generates configuration files for you to edit.

Revision as of 23:07, 5 May 2019

Dedicated Server Hosting Guide

Welcome, below you will find information on how to host a dedicated server on Linux and Windows.

Before you start you will need ports 7777 and 27015 forwarded. There are many port forwarding guides available on the Internet so we will not be going over that process.

To run multiple instances on same server you can use -PORT, -QUERYPORT, -GAMEINI, and -ENGINEINI parameters to specify different ports & config files for different server instances, just remember to use full path when referring to those files.

example:

./MordhauServer.sh -Port=7778 -QueryPort=27016 -GAMEINI=/home/*username*/steam/mordhau/Mordhau/Saved/Config/LinuxServer/Game2.ini -ENGINEINI=/home/*username*/steam/mordhau/Mordhau/Saved/Config/LinuxServer/Engine2.ini

Linux setup

Install SteamCMD dependencies

$ sudo apt-get install lib32gcc1

As the root user, create a separate user as follows under which we will run the server. We do this as a security precaution: you should never run the server as root.

$ useradd -m steam

Now, we'll swap to the newly created account:

$ su - steam

Or if you aren't currently logged in as root, use:

$ sudo -iu steam

Now, we can install SteamCMD. This installs it in the current directory:

$ curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar zxvf -

SteamCMD allows us to download and install the server and any updates that we may need at a later date. We'll create a simple SteamCMD script that we can run whenever we want to update our server. Create a file in the current directory with the following contents; I named mine update_mordhau.txt:

@ShutdownOnFailedCommand 1 @NoPromptForPassword 1 force_install_dir ./mordhau app_update 629800 validate quit

As you can see, the command app_update 629800 is the one that installs the server executable, with 629800 being the Steam app ID we want to install (Mordhau Dedicated Server). We also ask SteamCMD to install Mordhau to the mordhau folder in the current directory.

Running the script for the first time will cause SteamCMD to download the contents of the server application to your computer entirely. Any subsequent runs of this script will simply check for an update and install it if available. We can run it with:

$ ./steamcmd.sh +login <your_username> <your_password> +runscript update_mordhau.txt

Make sure to replace <your_username> and <your_password> with your steam login information (you should omit the angle brackets). Here you may be asked to enter a code from the Steam Mobile Authenticator. Note that if you used a package manager to install SteamCMD, you may need to use simply steamcmd instead of ./steamcmd.sh.

This should initiate a fairly large download, so this may take a few minutes or hours depending on the network bandwidth of the server. Just remember to run the above command when you want to update your server to a new Mordhau patch.

See the SteamCMD documentation for more information on how to use SteamCMD.

Install Game Server Dependencies

At this point you should have all the required files to run the server in the mordhau folder. Unfortunately, we still need to install a few more things before we can start the server. If you try and run the server at this point, you'll get some errors relating to libraries not being found. We need to install these dependencies manually, so let's go ahead and do that. Note that the following is very distro-specific: you'll have to use your own intuition for which package is correct if you aren't using a distro that uses apt (or maybe search the comments for a list of library names for your specific package manager).

Using apt, you can run the following (you'll need root access for this, temporarily):

$ sudo apt-get install -y libfontconfig1 libpangocairo-1.0-0 libnss3 libgconf2-4 libxi6 libxcursor1 libxss1 libxcomposite1 libasound2 libxdamage1 libxtst6 libatk1.0-0 libxrandr2

Configuring and Running the Server

Finally, we can now start thinking about how we want to configure the server. First, navigate to the folder where Mordhau is installed. If you've been following along, this will mean simply running cd mordhau.

If you type ls, you will see a few folders. The server configuration files are stored in Mordhau/Saved/Config/LinuxServer. If you navigate there and see what files are there (cd Mordhau/Saved/Config/LinuxServer && ls) you will see a few .ini files. The one we will want to edit the most is Game.ini. So let's open up that file in your favourite command line text editor (you could also download the file, edit it on your host machine and upload it back - but editing it in place is much simpler). nano is one such simple text editor, so simply run: nano Game.ini.

You should see something like this:

[/Script/Mordhau.MordhauGameSession]

MaxSlots=16

ServerName=

ServerPassword=

AdminPassword=

Admins=

BannedPlayers=

[/Script/Mordhau.MordhauGameMode]

MapRotation=SKM_Contraband

MapRotation=FFA_ThePit

Admins are added via SteamID and allow using console commands without logging in with the admin password

BannedPlayers is a list of blacklisted players that cannot join your server. You can add entries manually (with a similar syntax to the way you add admins).

Next, we see the MapRotation fields. When one map ends, the server loads the next entry in the MapRotation field. For example, if I just wanted Contraband Skirmish and Camp FFA (in that order), I'd write:

MapRotation=SKM_ContraBand

MapRotation=FFA_Camp

The map prefixes should be self-explanatory: SKM is Skirmish, FFA is FFA/Deathmatch, TDM is Team Deathmatch, etc.

Note that some people have reported issues with the Admins and MapRotation fields on the Windows dedicated server, saying that they simply don't work. If this is the case for you, try putting a '+' before each line that starts with Admins= or MapRotation= - this has fixed the issue for many. If you have any more information regarding this bug and how to fix it, please contact me so I can update the information here.

If you want to change the tickrate of your server (default is 30, 60 or 120 may improve gameplay), you need to edit the Engine.ini file in the same folder. Add the following:

[/Script/OnlineSubsystemUtils.IpNetDriver]

NetServerMaxTickRate=60

Having configured everything we want to configure, we can finally run the server. In the root of the mordhau folder, there should be a file called MordhauServer.sh - this is the script that actually runs the server. We can execute it with:

./MordhauServer.sh

After 15s or so, your server should be up and running. The problem with this method is that it's tied to the current command line session - as soon as you close your SSH connection, the server will close too. We need to run it in the background, using this command:

nohup ./MordhauServer.sh &

Instead of displaying the output directly to your screen, this will write the server log to a file in the current directory named nohup.out. Type man nohup for more details on this behaviour. Alternatively you can use systemd to run your server in the background. See this link for more information.

When you want to shut down the server, you'll need to type ps -a (or ps -ax if you don't see it) and look for the process ID of the game server. Then, close it with kill <pid> where you replace <pid> with the process ID you just found.

Windows setup

Installing SteamCMD

Download SteamCMD for Windows: https://steamcdn-a.akamaihd.net/client/installer/steamcmd.zip

Installing via Steam tools

1. With Steam open right click on your library and open up "tools"

2. Navigate to "MORDHAU Dedicated Server" and click install

3. Once you have the server files navigate to location below or wherever you chose to install the server files to.

"C:\Program Files\Steam\steamapps\common\Mordhau Dedicated Server"

4.Create a shortcut of "MordhauServer.exe"

5. Right click your new shortcut and select properties

6. Edit the target field and add -log to the end of it so a console window is displayed upon launch.

"C:\Program Files\Steam\steamapps\common\Mordhau Dedicated Server\MordhauServer.exe" -log


You will have to run the server once before it generates configuration files for you to edit.

Tweaks and configurations

Setting a default game mode

The default gamemode is chosen by ServerDefaultMap variable in /Mordhau/Saved/Config/*Server/Engine.ini, below are couple of examples for different default gamemodes:

For Horde:

[/Script/EngineSettings.GameMapsSettings]

ServerDefaultMap=/Game/Mordhau/Maps/DuelCamp/HRD_Camp.HRD_Camp

For Frontlines:

[/Script/EngineSettings.GameMapsSettings]

ServerDefaultMap=/Game/Mordhau/Maps/TaigaMap/FL_Taiga.FL_Taiga<

Setting map rotation

For Map Rotation you add your maplist into /Mordhau/Saved/Config/*Server/Game.ini

Front Line:

MapRotation=FL_Taiga

MapRotation=FL_MountainPeak

MapRotation=FL_Camp

MapRotation=FL_Grad

Skirmish:

MapRotation=SKM_Contraband

MapRotation=SKM_Camp

MapRotation=SKM_Grad

MapRotation=SKM_ThePit

MapRotation=SKM_MountainPeak

MapRotation=SKM_Tourney

MapRotation=SKM_Taiga

MapRotation=SKM_Taiga_64

MapRotation=SKM_MountainPeak_64

MapRotation=SKM_Grad_64

MapRotation=SKM_Camp_64

Team Deathmatch:

MapRotation=TDM_Contraband

MapRotation=TDM_Camp

MapRotation=TDM_Camp_64

MapRotation=TDM_Grad

MapRotation=TDM_ThePit

MapRotation=TDM_MountainPeak

MapRotation=TDM_Taiga

MapRotation=TDM_Taiga_64

MapRotation=TDM_Tourney

Deathmatch/Free For All:

MapRotation=FFA_Contraband

MapRotation=FFA_Camp

MapRotation=FFA_Grad

MapRotation=FFA_ThePit

MapRotation=FFA_MountainPeak

MapRotation=FFA_Taiga

MapRotation=FFA_Tourney

Horde:

MapRotation=HRD_Camp

MapRotation=HRD_Grad

MapRotation=HRD_Taiga

MapRotation=HRD_MountainPeak

Battle Royale:

MapRotation=BR_Grad

MapRotation=BR_Taiga


Console commands

References and information sources

Linux setup guide