Codename CURE II

Codename CURE II

评价数不足
Codename CURE II - Dedicated server setup
由 Hoobalugalar_X 制作
This guide will go through the steps necessary for setting up a CURE2 dedicated server for Windows and Linux.
   
奖励
收藏
已收藏
取消收藏
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 CURE2 server: **Note "./CURE2Server1" will install to "C:\SteamCMD\CURE2Server1", you may change this to a path of your choosing**
steamcmd.exe +force_install_dir ./CURE2Server1 +login anonymous +app_update 3725080 validate +quit


Once SteamCMD quits the CURE2 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\CURE2Server1") 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>\CURE2\Saved\Config\WindowsServer\ServerSettings.ini

If you edit this file you can alter how the server is run, such as:
- Server name: 20 characters max - Console variables to set such as: idle kick time, auto update and difficulty

** Note see list of useful cvars which can be added to this file at the end of the guide **
Windows - Running
To run the server open a command prompt and change directory into the server root directory (in our case:
cd C:\SteamCMD\CURE2Server1

Then run the command with parameters:
CURE2ServerAutoUpdate.bat -log -port=7778 -QueryPort=27016
**Note: you will need the "-log" option if you don't want the server to run as a hidden background process**

You can also create a batch file in the root directory such as "RunCURE2Server.bat" and place the command / parameters within so the server can be run by double clicking it:
start CURE2ServerAutoUpdate.bat -log -port=7778 -QueryPort=27016
**Note: you can also create a shortcut to "CURE2ServerAutoUpdate.bat", then add the parameters " -log -port=7778 -QueryPort=27016" in the target properties (after the end quote " )
Windows - Shutting Down
If or when manually closing down the server be sure the server cmd is the foreground window and press:
CTRL+C
This will gracefully close down the server, allowing it to properly destroy the session on the backend as opposed to clicking the X in the corner, which will instantly kill the process meaning the 'ghost' session to linger in the server browser for several minutes.
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 7777 and 27015.

However if you plan to join your own server from a client on the same computer or LAN, you will need to change the default server ports as the game client will require use of those same default ports.

As we already did in the previous section add "-port=7778 -QueryPort=27016" (or any ports of your choosing which are not already in use by another service) to your startup parameters, be sure to forward these ports from the router to the internal IP of the host machine in question (select UDP when port forwarding).

Your full startup parameters will look like:
CURE2ServerAutoUpdate.bat -log -port=7778 -QueryPort=27016
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 "ServerSettings.ini" (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 "CURE2Server1" for "CURE2Server2" and so on... or duplicate and rename the already fully setup "CURE2Server1" 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.

For each instance created you will need to change the ports the server uses for example:
"CURE2ServerAutoUpdate.bat -log -port=7778 -QueryPort=27016" for server 1 "CURE2ServerAutoUpdate.bat -log -port=7779 -QueryPort=27017" for server 2 "CURE2ServerAutoUpdate.bat -log -port=7780 -QueryPort=27018" and so on.
** Note: don't forget to forward any ports set here 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 CURE2 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.**

As CURE2 requires a 64 bit machine 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 CURE2 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 CURE2 server: **Note "./CURE2Server1" will install to "/home/steam/.steam/steamcmd/CURE2Server1", you may change this to a path of your choosing**
/usr/games/steamcmd +force_install_dir /home/steam/CURE2Server1 +login anonymous +app_update 3725080 validate +quit

Once SteamCMD quits the CURE2 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/CURE2Server1

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>/CURE2/Saved/Config/LinuxServer/ServerSettings.ini

By editing this file you can setup how you would like your server to run:
nano ./CURE2/Saved/Config/LinuxServer/ServerSettings.ini

Here is a description of some of the settings:
- Server name: 20 characters max - Console variables to set such as: idle kick time, auto update and difficulty

When you are content with your server settings file press Ctrl-X to exit nano, saving the changes as you do so.

** Note see list of useful cvars which can be added to this file at the end of the guide **
Linux - Running
As the steam user change directory to the root directory of our server, in our case:
cd /home/steam/CURE2Server1

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:
./CURE2ServerAutoUpdate.sh -log -port=7778 -QueryPort=27016

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 CURE2server1 ./CURE2ServerAutoUpdate.sh -log -port=7778 -QueryPort=27016
This will create a screen with the name of "CURE2server1" 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 CURE2server1 (to reattach / control this instance) screen -XS CURE2server1 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 7777 and 27015.

However if you plan to join your own server from a client on the same computer or LAN, you will need to change the default server ports as the game client will require use of those same default ports.

As we already did in the previous section add "-port=7778 -QueryPort=27016" (or any ports of your choosing which are not already in use by another service) to your startup parameters, be sure to forward these ports from the router to the internal IP of the host machine in question (select UDP when port forwarding).

Your full startup parameters will look like:
./CURE2ServerAutoUpdate.sh -log -port=7778 -QueryPort=27016
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 "ServerSettings.ini" (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 "CURE2Server1" for "CURE2Server2" and so on... or duplicate and rename the already fully setup "CURE2Server1" 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 "CURE2Server2": (and repeat for as many instances as you require)
cp -r ./CURE2Server1 ./CURE2Server2

For each instance created you will need to change the screen name as well as the ports each server uses.
e.g. Server 1:
screen -Sdm CURE2server1 ./CURE2Server1/CURE2ServerAutoUpdate.sh -log -port=7778 -QueryPort=27016
Server 2:
screen -Sdm CURE2server2 ./CURE2Server2/CURE2ServerAutoUpdate.sh -log -port=7779 -QueryPort=27017
Server 3:
screen -Sdm CURE2server3 ./CURE2Server3/CURE2ServerAutoUpdate.sh -log -port=7780 -QueryPort=27018
And so on... ** Note: don't forget to forward any ports set here 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).
Useful CVars
Here is a list of useful commands along with their default values, any of these can be placed next to “ExecCvars=” on a new line of the “ServerSetting.ini” file in order to customise the gameplay of your dedicated server.
mp.idlekicktime 180 - [Sets the amount of time (in seconds) for players to be kicked from the game if they idle.] mp.autoupdate 1 - [Sets the game to allow auto updating by shutting down the server (when there are either no players or at the end of the current match) when there is a steam update available... set this to 0 if you want to manually update your server] coop.difficulty 2 - [sets how difficult the game should be by default 0 = casual, 1 = average, 2 = skilled, 3 = insane]
1 条留言
pipiఌ 5 月 6 日 下午 12:05 
:nkGood: