Dedicated Server Setup

A Reign of Kings Dedicated server can be setup or rented from a Game Server Provider, search for one of these on the web or refer to Dedicated Server Providers for a list of providers.

## Server Requirements

Windows 7, 8, 8.1, Server 2008, Server 2012 & 64-Bit
Dual Core processor (not as CPU intensive)
4GB memory (currently uses around 2GB memory)
2GB disk space (install folder)
100MB disk space (save location folder in %APPDATA%)

## Step 1: Fetching Game Server files from SteamCMD

It is possible to fetch the steam files programmatically from Steam using SteamCMD.

1. Create a folder where you wish to store your RoK game server hosting files
2. Inside of the folder, place the newly downloading SteamCMD.exe file
3. Create a batch file named **SteamCMD.bat**
4. Place the following code in this batch file:

@echo off
start "" steamcmd.exe +login USER PASS +force\_install\_dir "C:\Some\Path\Where\You\Want\Game\Server\Files\To\Go" +app\_update 344760 validate +quit
1. Right-click SteamCMD.bat and Run as Administrator
2. Your game server files should be completely downloaded by now

## Step 1 (alternate method): Locating Game Server Files on Hard Drive

You can host RoK directly from your Steam common folder. To locate your common folder:

1. Right-click Reign of Kings from Steam, select **Properties**
2. Click **Local Files** tab
3. Click '*Browse Local Files* button

## Step 2: Setting up a Reign of Kings Dedicated Server

1. Create a batch file named **RoK.bat** in your newly created SteamCMD folder (Step 1) or your Steam common folder (Step 1: (alternate method)).
2. Place the following code in this batch file:

start "" ROK.exe -batchmode -nographics
Alternatively you can enable silent crashes and use the following code:

1. Right-click RoK.bat and Run as Administrator
2. ROK.exe will now be loaded in
3. Open up '*Task Manager* by right clicking on your Windows task bar and clicking Task Manager
4. Find the process ROK.exe and terminate it
5. You will now have a **Configuration** folder in your RoK root files. Inside of this folder you will find the following .cfg files:
	1. DeathMessages.cfg
	2. Permissions.cfg
	3. ServerSettings.cfg
	4. Users.cfg

## Step 3: Port Forwarding

Add an incoming rule to your Windows Firewall to allow UDP port 7350 (or whichever port you are using).

You may additionally need to add a forwarding rule to your network router. You can use PortForward.com to read how to do this.

## Tips & Tricks

* If you have scheduled automatic restarts or force quit your ROK.exe process, the last 5 minutes of data will not be saved. You can notify your players to logout manually while in the gameserver or use the /shutdown admin command to prevent data loss.
* You can add colors to your server hostname by using the [FFFFFF] color hex format placed directly in front of the text you wish to color. Randomcolorcode.com to find a color.
* Let your players know that you should only use common characters (spaces, numbers, and characters) to prevent data loss. This is only a theory, has not been tested!

## Configuring your RoK Game Server!

Now comes the fun part, setting up your RoK game server to your liking.

## Location of World Saves

1. Navigate to your Application Data folder. To do this, you can type %APPDATA% in your Start -> Search Programs and Files input box and press Enter.
2. Navigate up one directory.
3. Navigate to the LocalLow\CodeHatch\Reign of Kings\ directory.
4. You will see a HeatMaps folder and a bunch of folders prefixed with Slot
5. Navigate to the SlotXXX where XXX is the value of the worldSave variable from your ServerSettings.cfg file
6. You can delete Players from the Players folder. To complete wipe your server, remove all of the files in this folder and restart your game server.

## Tools

(link doesnt work anymore)https://gyazo.com/17ece5f4dea4e8fa43fb1be038c54b8a - automatically restart your server with a nice, easy to use tool