Codename CURE

Codename CURE

Not enough ratings
CURE - Dedicated server setup
By Hoobalugalar_X
This guide will go through the steps necessary for setting up a Codename CURE dedicated server for Windows and Linux.
   
Award
Favorite
Favorited
Unfavorite
Windows - Installation
Create a folder for steamcmd, for example:
C:\SteamCMD

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

Extract the contents of the zip to the folder.

Open a command prompt window, quickest / most universal way:
press: Windows Key + R type: cmd click: Ok



Change directory into the folder you created for SteamCMD
cd C:\SteamCMD

**(If the directory you created is on a different drive than C: first type the drive letter followed by colon ":" to switch the cmd to that drive)** e.g.
D: cd D:\SteamCMD

Run the following to install the CURE server: **Note "./CureServer1" will install to "C:\SteamCMD\CureServer1", you may change this to a path of your choosing**
steamcmd.exe +force_install_dir ./CureServer1 +login anonymous +app_update 383410 validate +quit


Once SteamCMD quits the Gemini server will be successfully installed! If you make use of the auto update capabilities of the game/steam you shouldn't need to run this again.

** Note If you prefer to manually manage the server you will need to shut down the server and come back and run this command periodically when new updates are available **
Windows - Setup
In the server root directory (in our case "C:\SteamCMD\CureServer1") create a text file called:
steam.txt

In the file add the full path to the "steamcmd.exe" executable we just used to download the server, in our case:
C:\SteamCMD\steamcmd.exe
This is required for the auto update script to be able to call steamcmd when there is an update available.

In the server root directory run the batch script:
SetupDefaultServerSettings.bat

This will create the file:
<Server Root dir>\cure\cfg\server.cfg

If you edit this file you can alter how the server is run including setting a hostname, password etc...

In server.cfg If you want to use the auto restart / update system you will need to uncomment (remove the '//' in front of):
sv_autoupdatetime 36000

36000 seconds (10 hours) is the default time set here for the server to restart and check for updates but this can be adjusted to a time of your choosing.
Windows - Running
To run the server open a command prompt and change directory into the server root directory (in our case:
cd C:\SteamCMD\CureServer1

Then run the command with parameters:
CureServerAutoUpdate.bat –game cure –console +map cbe_frostbite
Replacing "cbe_frostbite" with the starting map of your choice.

You can also create a batch file in the root directory such as "RunCureServer.bat" and place the command / parameters within so the server can be run by double clicking it:
start CureServerAutoUpdate.bat –game cure –console +map cbe_frostbite
**Note: you can also create a shortcut to "CureServerAutoUpdate.bat", then add the parameters " –game cure –console +map cbe_frostbite" in the target properties (after the end quote " )
Windows - Domestic Connections
In order to run a dedicated server from your home network you will first need to forward ports from your router to the machine you plan to run the server on, by default the game uses 27015.

However if you plan to have multiple instances the port number will increment for each instance you start 27015, 27016, 27017, 27018 etc.. so be sure to forward these ports from the router to the internal IP of the host machine in question (select UDP when port forwarding).
Windows - Multiple Instances
Although multiple instances running from the same install directory are possible, it is NOT recommended! The auto update mechanism would not function properly as each instance of the server would not be shut down at the same time, so you would have to disable that system and install updates manually. Also each instance cannot have a separate "server.cfg" (so the server name and other settings would have to be identical for each instance).

Instead it is recommended for each instance of your server to have it own separate directory, that way separate settings can be set and the auto update mechanism can safely shut down each server and update those particular files when either no players are playing or at the end of a match.

To create multiple server directories you can either restart this guide for each changing "CureServer1" for "CureServer2" and so on... or duplicate and rename the already fully setup "CureServer1" folder, which when an instance is started from the new folder the auto update script will detect the directory it is running from and only update the files therein.

** Note: don't forget ports will increment for each instance (27015 for server1, 27016 for server 2 etc..) so you must forward the appropriate ports to the host machine if you are running a domestic connection **

You can do this for as many server instances as you like (or your hosts hardware/bandwidth can handle).
Linux - Installation
This guide will be for Ubuntu servers (as this is a popular Linux distribution and my personal go to), but is likely adaptable to other distributions, as many of the steps should be the same aside from mainly differences in package managers / installing prerequisites.

Create a user account named "steam" to run SteamCMD safely, isolating it from the rest of the operating system. It is not recommended to run steamcmd while operating as the root user as to do so is a security risk.

As the root user (or user with sudo privileges), create the steam user (we will switch to this account later in order to run the SteamCMD and ultimately the Cure server itself):
sudo adduser steam
Creating a password, then pressing return on the following setup prompts.

** Note: if running directly as the root user remove the "sudo" from the beginning of the commands, only keep it if running a separate account with sudo privileges, most commands will work regardless but some occasionally don't seem to like it.**

You will need to add multiverse and other dependencies:
sudo add-apt-repository multiverse sudo dpkg --add-architecture i386 sudo apt update sudo apt install steamcmd sudo apt install screen

SteamCMD is now installed, this will allow us to install and update the Gemini server, whilst the screen program will allow us to run server instances on a headless server without having to keep an SSH connection open.

Now we have the prerequisites installed switch to the steam user account we created earlier:
sudo su steam

Make sure we are in steam users home directory:
cd

Run the following to install the Cure server: **Note "./CureServer1" will install to "/home/steam/.steam/steamcmd/CureServer1", you may change this to a path of your choosing**
/usr/games/steamcmd +force_install_dir /home/steam/CureServer1 +login anonymous +app_update 383410 validate +quit

Once SteamCMD quits the Cure server will be successfully installed! If you make use of the auto update capabilities of the game/steam you shouldn't need to run this again.

** Note If you prefer to manually manage the server you will need to shut down the server and come back and run this command periodically when new updates are available **
Linux - Setup
As the steam user change directory to the root directory of our server, in our case:
cd /home/steam/CureServer1

Create a text file in this directory called "steam.txt":
nano steam.txt

In the file add the full path to the "steamcmd" executable we just used to download the server, in our case:
/usr/games/steamcmd
Press Ctrl-X to exit nano, followed by "Y" then "Return" to save changes. This is required for the auto update script to be able to call steamcmd when there is an update available.

Now run the following script:
./SetupDefaultServerSettings.sh
This will create the file:
<Server Root dir>/cure/cfg/server.cfg

If you edit this file you can alter how the server is run including setting a hostname, password etc...
nano cure/cfg/server.cfg

In here If you want to use the auto restart / update system you will need to uncomment (remove the '//' in front of):
sv_autoupdatetime 36000

36000 seconds (10 hours) is the default time set here for the server to restart and check for updates but this can be adjusted to a time of your choosing.
Linux - Running
As the steam user change directory to the root directory of our server, in our case:
cd /home/steam/CureServer1

If you are running desktop Linux with terminal emulators available (which can be left open) you can run the server directly by running the following command with parameters:
./CureServerAutoUpdate.sh -game cure -console +map cbe_frostbite
Replacing "cbe_frostbite" with the starting map of your choice.

However the most likely use case for a Linux server is remote/headless via SSH in which case the terminal session will end when you disconnect from SSH. To allow the server to continue to run when we disconnect we can setup a background virtual terminal session via "screen" so instead run:
screen -Sdm cureserver1 ./CureServerAutoUpdate.sh -game cure -console +map cbe_frostbite

This will create a screen with the name of "cureserver1" and launch the server inside of it, this can be listed, reattached, or quit at a later time via:
screen -ls (to see what screens are running) screen -r cureserver1 (to reattach / control this instance) screen -XS cureserver1 quit (to quit this instance)
Linux - Domestic Connections
In order to run a dedicated server from your home network you will first need to forward ports from your router to the machine you plan to run the server on, by default the game uses 27015.

However if you plan to have multiple instances the port number will increment for each instance you start 27015, 27016, 27017, 27018 etc.. so be sure to forward these ports from the router to the internal IP of the host machine in question (select UDP when port forwarding).
Linux - Multiple Instances
Although multiple instances running from the same install directory are possible, it is NOT recommended! The auto update mechanism would not function properly as each instance of the server would not be shut down at the same time, so you would have to disable that system and install updates manually. Also each instance cannot have a separate "server.cfg" (so the server name and other settings would have to be identical for each instance).

Instead it is recommended for each instance of your server to have it own separate directory, that way separate settings can be set and the auto update mechanism can safely shut down each server and update those particular files when either no players are playing or at the end of a match.

To create multiple server directories you can either restart this guide for each, changing "CureServer1" for "CureServer2" and so on... or duplicate and rename the already fully setup "CureServer1" folder, which when an instance is started from the new folder the auto update script will detect the directory it is running from and only update the files therein.

To do the latter you will need to change up a directory to:
cd /home/steam

Then duplicate as "CureServer2": (and repeat for as many instances as you require)
cp -r ./CureServer1 ./CureServer2

For each instance created you will need to change the screen name each server uses.
e.g. Server 1:
screen -Sdm cureserver1 ./CureServer1/CureServerAutoUpdate.sh -game cure -console +map cbe_frostbite
Server 2:
screen -Sdm cureserver2 ./CureServer2/CureServerAutoUpdate.sh -game cure -console +map cbe_frostbite
Server 3:
screen -Sdm cureserver3 ./CureServer3/CureServerAutoUpdate.sh -game cure -console +map cbe_frostbite
And so on... ** Note: don't forget ports will increment for each instance (27015 for server1, 27016 for server 2 etc..) so you must forward the appropriate ports to the host machine if you are running a domestic connection **

You can do this for as many server instances as you like (or your hosts hardware/bandwidth can handle).