Dedicated Server Setup: Difference between revisions

From Empires Wiki
Jump to navigation Jump to search
m (→‎Dedicated Server - SteamCMD: fix outdated district map name in the start command :D)
 
(69 intermediate revisions by 11 users not shown)
Line 1: Line 1:
{{Sitenav|Dedicated Server Setup}}
{{ServerResources}}


== Dedicated Server (Windows) ==
Dedicated servers are like the listen servers (which can be created by pressing the "create server" button on the main menu), but they don't require a copy of the game to be running. This is less resource intensive as the server doesn't need to spend any time rendering graphics.
=== Downloading ===
First of all you need the [http://steampowered.com/download/hldsupdatetool.exe HLDS Update Tool]. This is what we use to update/download the server. You will also need Empires Dedicated Server from the [http://empiresmod.com/download.php Empires Download Page].


If you want to use [http://www.mani-admin-plugin.com/ Mani Admin Plugin], make sure you download it before going any further.
== Installation ==
There are two supported ways of installing a dedicated server. On Windows and Linux, you can install the server using the SteamCMD utility. On Debian-based distributions of linux, you can also install the server through APT, this will set it up as a service and with tmux.


=== Installing ===
=== Dedicated Server - SteamCMD ===
* First we need to download the SDS (Source Dedicated Server). To download we open up hldsupdatetool.exe and download the tool to an arbitrary location on your machine, for example:
C:\HL2DS
* When you have finished installing the update tool open the install folder in a command prompt and type:
hldsupdatetool.exe -command update -game "tf" -dir C:\HL2DS 


* If that doesnt work or your stuck or having trouble getting tf then you can go [http://www.srcds.com/db/engine.php?subaction=showfull&id=1097362093&archive= HERE] for a more indepth tutorial on how to get it.
The Empires Dedicated Server can be installed using the [https://developer.valvesoftware.com/wiki/SteamCMD SteamCMD] utility. The server has an appid of 460040, and must be downloaded while logged in as an anonymous user.


{{Tip|Make sure you replace C:\HL2DS with your install path if it's different.}}
To install the server on Windows:
*[https://developer.valvesoftware.com/wiki/SteamCMD#Downloading_SteamCMD Install SteamCMD].
*Open a command line window with elevated / local administrator privileges
*Browse to the location where SteamCMD was installed, and enter this command:
<pre>
steamcmd.exe +login anonymous +app_update 460040 validate +quit
</pre>
*This same command can also be used to update Empires Dedicated Server.


This will download all files necessary to host a Team Fortress 2 server (and Empires). And remember to "Go get yourself a cup of coffee." as valve said, this will take some time
Once the server has been downloaded, you can launch the server by navigating to the installed location of SRCDS.exe and running the following console command:
<pre>
srcds.exe -game "empires" -console -toconsole -secure +map con_district402 +maxplayers 64
</pre>


* Install the Empires Dedicated Server files to "C:\HL2DS\orangebox\empires" (use your own install path).
To allow players to connect to your server from outside your local network, you may need to port-forward the following ports:  
* Create a shortcut of '''srcds.exe''' and place it where you want then go to properties of the shortcut. Add the following to the end of the shortcut target:  
* UDP 27005
-game empires +maxplayers 14 -port 27015 -console +map emp_canyon -autoupdate
* TCP and UDP 27015
It sould look like this;
srcds.exe -game empires +maxplayers 14 -port 27015 -console +map emp_canyon -autoupdate
{{Tip|You can adjust your port and maxplayers via the shortcut or the ''server.cfg'' file.}}


=== Configuration ===
=== Dedicated Server - APT ===
Next, edit your mapcycle.txt and server.cfg files to your liking.  
This method will install the server as a service, with tmux. (with tmux you run the server in a separate terminal window, so you can switch between the dedicated server and linux environment) <br>
{{Warning|When editing your server.cfg remember to change your '''rcon_password''' and '''hostname''' directives!}}
<br>
rcon_password "pass"  //Your rcon password
Video tutorial: https://www.youtube.com/watch?v=RVvJTphiG24 <br>
hostname "Servername" //The name of your server
<br>
Installing a dedicated server is supported on [https://www.debian.org/CD/netinst/ 32 bit Debian 10]. <br>
If you have a 64 bit install you might need to execute the following as root: <br>


These are the most important settings to change, there are more in the cfg so test around what is best for you.
dpkg --add-architecture i386
apt update
apt install lib32gcc1


=== Starting ===
Execute the following in a root shell to add the key and repository:
You should now be able to double-click your server shortcut, which will start up your dedicated server.
mkdir -p /etc/apt/keyrings/
wget -qO- https://deb1.ws.maxmaton.nl/debian/signing.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/maxmaton.gpg >/dev/null
echo 'deb [signed-by=/etc/apt/keyrings/maxmaton.gpg] http://deb.maxmaton.nl/debian buster main non-free' | sudo tee /etc/apt/sources.list.d/maxmaton.list


== Dedicated Server (Linux) ==
After that you can continue with:
=== Downloading ===
apt update
First of all you need the [http://storefront.steampowered.com/download/hldsupdatetool.bin HLDS Update Tool]. This is what we use to update/download the server. You will also need Empires Dedicated Server from the [http://empiresmod.com/download.php Empires Download Page].
apt install empires-server
''When it shows the license agreement, you have to press TAB to put your cursor to OK button.'' <br>
'''Your server is now up and running.''' <br>
<br>
You might also need to manually port forward the following ports:
* UDP 27005
* TCP and UDP 27015


=== Installing SDS ===
If you also want the community provided maps, you can install the empires-server-maps-extra package <br>
Now we have to extract the HLDS-Update-Tool.
''Warning!'' <br>
* Go to the homedir of the user who is designated to run the HL2-Server and create a subdir.
''Takes a long time to install.'' <br>
hl2usr@hl2srv ~ # mkdir hl2
''This pack is no longer maintained, and has outdated versions of maps.''  <br>
* Copy the HLDS-Update-Tool into your new subdir and chmod it to make it executable:
  apt install empires-server-maps-extra
  hl2usr@hl2srv ~/hl2 # chmod +x hldsupdatetool.bin
* Run the binary:
hl2usr@hl2srv ~/hl2 # ./hldsupdatetool.bin
* If you get a warning about not finding "compress", go grab the "[http://ncompress.sourceforge.net/ ncompress]" package on Redhat/Fedora:
  hl2usr@hl2srv ~/hl2 # yum install ncompress
* Now that you have finished extracting the Update-Tool you can use it to download all required files:
hl2usr@hl2srv ~/hl2 # ./steam -command update -game "tf" -dir .
Get yourself a cup of tea, coffee, soda, etc., and have a rest. Depending on your connection speed this can take some time


=== Installing Empires ===
==== Opening the server console ====
Next, we have to extract the previously downloaded Empires-Server.
To open the server console, execute the following command:
* Copy the zip-file (something like empires_v1xxx_server.zip) to the folder where the HLDS-Update-Tool resides (''~/hl2'' in this example) and extract it:
hl2usr@hl2srv ~/hl2 # unzip empires_v1xxx_server.zip -d orangebox
This command creates the directory ''~hl2/orangebox/empires'' and extracts all needed files into it.


=== Configuration ===
su - empires -c "tmux attach"
Before you can start your new Dedicated Server the servers config files have to be altered to satisfy your needs.
* cd to the ''"orangebox/empires"'' subdir
* Edit the file ''mapcycle.txt'' with your prefered text editor and add/remove the maps you like/don't like in your mapcycle
* cd to the config dir of your Empires installation (''~/hl2/orangebox/empires/cfg'' in this example)
* Edit the ''server.cfg'' to your liking
{{Warning|When editing your server.cfg remember to change your '''rcon_password''' and '''hostname''' directives!}}
rcon_password "pass"  //Your rcon password
hostname "Servername" //The name of your server


=== Starting ===
To get out of the server console, dont do CTRL + C or you will kill the server <br>
Now your server should be ready for startup
You can do CTRL + B and then CTRL + D to detach and get out of server console <br>
* cd to your Dedicated-Servers basedir (''~/hl2'' in this example)
You can do CTRL + B and then page up and page down to scroll higher in console, then ESC to get out of the CTRL + B mode (tmux basics, you can google them) <br>
* Start the Server:
hl2usr@hl2srv ~/hl2 # ./srcds_run -game empires +maxplayers 14 -port 27015 -console +map emp_canyon -autoupdate
{{Tip|Use a terminal multiplexer like [http://www.gnu.org/software/screen/ Screen] to be able to detach the HL2-Server Console and disconnect from your servers shell without terminating the HL2-Daemon}}
* You can create a Bash-File in your Dedicated-Servers basedir to easily start your Empires-Server in a virtual Screen-Terminal:
{{ Box File|empires.sh|
<pre>
#! /bin/bash
screen -A -d -m -S empires -t empires ./srcds_run -game empires +maxplayers 14 -port 27015 -console +map emp_canyon -autoupdate
</pre>
}}
Please note that if you wish to retain explicit control over when updates happen on your server you can omit the -autoupdate option.
* Now make the Bash-File executable and run it:
hl2usr@hl2srv ~/hl2 # chmod +x empires.sh
hl2usr@hl2srv ~/hl2 # ./empires.sh
The Dedicated-Server now runs in the background. You can attach to the Screen-Terminal by typing:
hl2usr@hl2srv ~/hl2 # screen -r empires


You can detach from the Screen-Terminal and leave the server running by typing a Control-a followed by "d".
You can also start or stop the empires-server service
service empires-server stop
service empires-server start


To stop the server, reattach to the Screen-Terminal and type Control-c.
Typing quit in server console will automatically restart the server. <br>
When server crashes it will restart automatically. (unless it freezes) <br>


If you intend to run multiple servers then you will need to set a unique value for the port used & the the Screen-Terminal name used via the -port & -S options in the above command.
Server folder is located in '''/var/lib/empires'''


=== Monitoring server resources ===
Start parameters can be edited in '''/etc/empires-server.conf'''
==== Bandwidth ====
For monitor server bandwidth you can use "iftop" which will display bandwidth consumption on a per port/connections basis. NB: This program needs to run as '''root'''.


Assuming your running empires on the default 27015 port the follow will filter to show only empires traffic:
More detailed/full start parameters are inside the service '''/usr/bin/empires-server'''
<pre>
root@hl2srv ~/hl2 # iftop -P -f "port 27015"
</pre>


A lightly loaded server with 4 active players and 7 recently departed:
== Configuration ==
<pre>
                50.0Kb          100Kb          150Kb          200Kb      250Kb
└───────────────┴───────────────┴───────────────┴───────────────┴───────────────
oneltdhost.net:27015      <=> guru239.netsonic.fi:13765  43.1Kb  44.8Kb  44.5Kb
oneltdhost.net:27015      <=> 71-213-216-109.sxcy.:27005 41.1Kb  43.8Kb  41.2Kb
oneltdhost.net:27015      <=> cc300737-b.hnglo1.ov:27005 40.7Kb  42.2Kb  36.8Kb
oneltdhost.net:27015      <=> dynamic-acs-24-239-4:27011 27.7Kb  27.9Kb  33.7Kb
oneltdhost.net:27015      <=> host-091-097-139-118:49167    0b    175b    44b
oneltdhost.net:27015      <=> 120.139.76-8:netview-aix-8    0b      0b    44b
oneltdhost.net:27015      <=> ANice-754-1-3-:megaco-h248    0b      0b    44b
oneltdhost.net:27015      <=> host86-139-6-13.rang:64937    0b      0b    44b
oneltdhost.net:27015      <=> daruck-69-4.gimp.co:finger    0b      0b    44b
oneltdhost.net:27015      <=> c24-143-85-34.s:t1distproc    0b      0b    44b
oneltdhost.net:27015      <=> 213-67-55-231-no157.:57200    0b      0b    44b


=== Cvars ===


Most configuration can be done through the use of [Server Cvars]. There are several ways commands can be set to run automatically:


* Include the command in the call to SRCDS. This is how the <code>maxplayers</code> cvar is set in the example above. This will run the command as soon as possible.
* Include the command in the <code>/cfg/autoexe.cfg</code> file. This will run the command once on server start-up, before any maps have loaded.
* Include the command in the <code>/cfg/server.cfg</code> file. This will run the command every time any map loads.
* Include the command in a <code>/cfg/maps/[mapname].cfg</code> file. If there is a <code>.cfg</code> file in this directory with the same name as a map, the commands in it will be run every time that map loads. Use this for map-specific configuration changes, such as adjusting the resource multiplier or ticket count.


The following configuration options are the ones you will most likely need to change:


{| class="wikitable"
|+ Common Configuration
!  Command !! Description
|-
| hostname || The name of your server, as it appears in the server browser.
|-
| rcon_password || A password that can be used to send server commands remotely.
{{Warning|Set this to a secure password, and do not share it freely. Anyone with this password can execute admin commands on your server.}}
|-
| sv_password || If this is set, players will be required to enter this password before joining the server.
|-
| sv_downloadurl || The URL of a [[FastDL]] server.
|-
| sv_region || A number representing the region your server is located in. A list of valid regions [[https://developer.valvesoftware.com/wiki/Sv_region can be found here]].
|-
| sv_contact || An email address players can use to contact the server owner.
|-
| sv_setsteamaccount || Link the server to a Steam account using an authentication token.
{{Fixme|Why/under what circumstances should this be done?}}
|-
| maxplayers || The maximum number of players allowed to join the server. This can only be set as part of the command that launches SRCDS.
|}
=== FastDL Setup ===


The [https://developer.valvesoftware.com/wiki/FastDL FastDL system] allows server owners to specify a URL from which custom content will be downloaded. This speeds up the process of players downloading custom content when joining a server, so setting this system up is highly recommended.


────────────────────────────────────────────────────────────────────────────────
{{Fixme|We need instructions here on how to set up a FastDL server.}}
TX:            cumm:  824KB  peak:  88.7Kb  rates:  66.0Kb  69.9Kb  72.9Kb
RX:                    798KB          92.1Kb          86.6Kb  89.0Kb  83.5Kb
TOTAL:                1.58MB            174Kb            153Kb  159Kb  156Kb
</pre>


Furthermore, you can hit the "t" key to display each connection on a single line rather than show receive and transmit on two lines.
== Server Extensions ==
There are several plugins available for use in Empires. Two extension systems are available (and can run in parallel):


==== CPU/Disk ====
* [http://www.sourcemod.net/ SourceMod] is the most common system, and is used for the majority of plugins. Handy SourceMod plugins that have been confirmed to work on Empires servers are:
For CPU usage you can use top (default installed all linux distros), htop (enhanced 'top') or atop.
** [http://raegquit.com/beerdude26/empires-plugins/rg_ungrief.smx Ungrief Command Vehicle] - Teleports the specified command vehicle to where you are looking. Usage: !ungrief <nf | be | imp>
** [http://www.sourcebans.net/ SourceBans] - A free global administration and banning system for Source engine based servers.
** [http://kigenac.com/viewtopic.php?f=4&t=231 Kigen's Anti-Cheat] (Requires Sockets 3.0.1 plugin) - An extensive anti-cheating plugin.
** For more plugins, look at the [[Sourcemod Plugins]] page.
* [http://www.sourceop.com/wiki/Installing SourceOp] is less popular, but is required to run an anti-DoS plugin:
** [http://www.sourceop.com/modules.php?name=Downloads&d_op=viewdownload&cid=9 DoS Attack Fixer] - Protects against A2C_PRINT and other spam.


[http://htop.sourceforge.net/ htop] gives a very good "at-a-glance" showing overall CPU core load, memory usage and the top dozen or so processes.
Both systems themselves run on [http://www.sourcemm.net/ MetaMod], allowing them to run in parallel.


<pre>
== Tips and Tricks ==
=== Customize server.cfg settings ===
As the server.cfg (amongst others) can be overwritten during upgrade and you may wish to have your server run in different "modes" such as password protected clan match/practice, increased resource rates for "tank wars", etc, it is best to treat your server.cfg as "read-only".


  1  [||                        2.0%]    Tasks: 85 total, 2 running
Any default settings you wish to use can be placed in a separate file such as "myserver.cfg". At the end of server.cfg, you can then add the line "exec myserver.cfg".
  2  [||||||||                23.3%]    Load average: 0.36 0.23 0.14
  Mem[||||||||||||||||||||845/3934MB]    Uptime: 10 days, 02:41:32
  Swp[|                    30/1913MB]


  PID USER    PRI  NI  VIRT  RES  SHR S CPU% MEM%  TIME+  Command
This way, server.cfg will then run myserver.cfg and override any server.cfg settings.
27647 hl2      -3  0  161M 94724 12344 S 57.0  2.4 14:37.76 ./srcds_i486 -game
12337 daruck    20  0  468M  210M  3400 R  8.0  5.3 13h08:54 ./isagimp
27649 hl2      -3  0  161M 94724 12344 S  5.0  2.4  1:38.01 ./srcds_i486 -game
28030 hl2      20  0 14984  1160  912 R  1.0  0.0  0:04.71 htop
27997 hl2        0 -20 15464  3188  2424 S  0.0  0.1  0:02.20 atop
11298 named    20  0  177M 31556  2196 S  0.0  0.8 34:28.57 /usr/sbin/named -u
11296 named    20  0  177M 31556  2196 S  0.0  0.8 30:05.04 /usr/sbin/named -u
11295 named    20  0  177M 31556  2196 S  0.0  0.8 25:34.77 /usr/sbin/named -u
2149 mysql    20  0  324M 41132  5068 S  0.0  1.0  2h02:27 /usr/libexec/mysql
2163 mysql    20  0  324M 41132  5068 S  0.0  1.0 50:19.25 /usr/libexec/mysql
    1 root      20  0 10308  716  596 S  0.0  0.0  0:08.52 init [2]
  556 root      16  -4 12588  768  404 S  0.0  0.0  0:00.50 /sbin/udevd -d
1668 root      20  0  6684  916  432 S  0.0  0.0  2:50.50 /sbin/dhclient -1
1728 rpc      20  0 18660  624  424 S  0.0  0.0  0:00.63 rpcbind
1748 root      20  0 21044  1316  564 S  0.0  0.0  0:00.15 pcscd
1756 root      20  0 90636  1292  648 S  0.0  0.0  4:56.45 rsyslogd -m 0
F1Help  F2Setup F3SearchF4InvertF5Tree  F6SortByF7Nice -F8Nice +F9Kill  F10Quit
</pre>


Loading various server "modes" can then be done by calling them in the server console:


[http://www.atcomputing.nl/Tools/atop/download-atop.html atop] will give you the missing Hard disk activity monitor by way of the "DSK" line's "busy" percentage:
<pre>
<pre>
ATOP - oneltdhost        2008/12/31  12:38:24              10 seconds elapsed
rcon exec tankwars.cfg
PRC | sys  1.10s | user  5.76s | #proc    121 | #zombie    0 | #exit      0 |
</pre>
CPU | sys      4% | user    21% | irq      0% | idle    174% | wait      0% |
cpu | sys      2% | user    19% | irq      0% | idle    78% | cpu001 w  0% |
cpu | sys      2% | user      1% | irq      0% | idle    97% | cpu000 w  0% |
CPL | avg1  0.19 | avg5    0.20 | avg15  0.12 | csw    18728 | intr    3847 |
MEM | tot    3.8G | free  93.8M | cache  2.9G | buff    4.4M | slab  306.0M |
SWP | tot    1.9G | free    1.8G |              | vmcom 972.8M | vmlim  3.8G |
DSK |        sda | busy      0% | read      12 | write      9 | avio    1 ms |
NET | transport  | tcpi    679 | tcpo    704 | udpi    805 | udpo    620 |
NET | network    | ipi    1498 | ipo    1332 | ipfrw      0 | deliv  1485 |
NET | eth0    0% | pcki    1498 | pcko    1332 | si  344 Kbps | so  279 Kbps |


  PID  SYSCPU  USRCPU  VGROW  RGROW  RDDSK  WRDSK  ST EXC S  CPU CMD    1/1
If you want a mode to be automatically loaded after map change / server restart, you can add another line to server.cfg below the "exec myserver.cfg" entry.
27647  0.73s  5.55s    0K    0K    0K    0K  --  - S  62% srcds_i486
2149  0.07s  0.11s    0K    0K    0K    0K  --  - S  2% mysqld
28030  0.10s  0.03s    0K    0K    0K    0K  --  - S  1% cheese
27997  0.03s  0.00s    0K    0K    0K    0K  --  - R  0% and
11294  0.00s  0.01s    0K    0K    0K    0K  --  - S  0% biscuits
12336  0.00s  0.00s    0K    0K    0K    0K  --  - S  0% screen
</pre>


== Tip and Tricks ==
As an example of custom configuration you might want to use, the following line will disable the ability to join spectators at the start of the round:
=== Modularise server.cfg settings ===
As the server.cfg (amongst others) can be overwritten during upgrade and you may wish to have your server run in different "modes" such as password protected clan match/practice, increase resource rates for "tank wars", etc it's best to treat your server.cfg as "read-only" and any default settings you wish to have place them in a unique filename e.g. myserver.cfg then add a single line to the end of server.cfg "exec myserver.cfg"


This way server.cfg will then run myserver.cfg and override any server.cfg settings.
For example to set your server's hostname you'd add the following to myserver.cfg
<pre>
<pre>
hostname "My Empires Server"
emp_allowspectators 0; wait 30000; emp_allowspectators 1
</pre>
</pre>


In addition to myserver.cfg you can then create modified files to accommodate your various server "modes" which can either be called via
It should be put at the end of the .cfg file so as to not delay any subsequent commands. The wait command delays all further commands by the amount specified in 1/100ths of a second.
 
== Running a beta server ==
Running a beta server is just like a normal server, with the desired steam branch mentioned when downloading the server package.
 
<pre>
<pre>
rcon exec tankwars.cfg
steamcmd.exe +login anonymous +app_update 460040 -beta beta validate +quit
</pre>
</pre>
Or if you want this mode to automatically survive a map change/server restart, add another line to server.cfg below your "exec myserver.cfg" entry.


See this link for more info on automating server creation, and on switching to specific steam branches.
https://developer.valvesoftware.com/wiki/SteamCMD#Automating_SteamCMD


== Related Links ==
== Related Links ==
* [http://server.counter-strike.net/server.php?cmd=cmdall General HL2 Directives/Commands]
* [http://server.counter-strike.net/server.php?cmd=cmdall General HL2 Directives/Commands]
* [http://www.mani-admin-plugin.com/ Mani Admin Plugin]
* [http://www.sourcemod.net/ SourceMod]
* [https://pastebin.com/SXsp0r2F How to create an Empires Server on Windows from A to Z.]

Latest revision as of 05:12, 13 March 2024

Empires Server Resources
Dedicated Server Setup | Cvars | Optimization | Sourcemod Plugins



Dedicated servers are like the listen servers (which can be created by pressing the "create server" button on the main menu), but they don't require a copy of the game to be running. This is less resource intensive as the server doesn't need to spend any time rendering graphics.

Installation

There are two supported ways of installing a dedicated server. On Windows and Linux, you can install the server using the SteamCMD utility. On Debian-based distributions of linux, you can also install the server through APT, this will set it up as a service and with tmux.

Dedicated Server - SteamCMD

The Empires Dedicated Server can be installed using the SteamCMD utility. The server has an appid of 460040, and must be downloaded while logged in as an anonymous user.

To install the server on Windows:

  • Install SteamCMD.
  • Open a command line window with elevated / local administrator privileges
  • Browse to the location where SteamCMD was installed, and enter this command:
steamcmd.exe +login anonymous +app_update 460040 validate +quit
  • This same command can also be used to update Empires Dedicated Server.

Once the server has been downloaded, you can launch the server by navigating to the installed location of SRCDS.exe and running the following console command:

srcds.exe -game "empires" -console -toconsole -secure +map con_district402 +maxplayers 64

To allow players to connect to your server from outside your local network, you may need to port-forward the following ports:

  • UDP 27005
  • TCP and UDP 27015

Dedicated Server - APT

This method will install the server as a service, with tmux. (with tmux you run the server in a separate terminal window, so you can switch between the dedicated server and linux environment)

Video tutorial: https://www.youtube.com/watch?v=RVvJTphiG24

Installing a dedicated server is supported on 32 bit Debian 10.
If you have a 64 bit install you might need to execute the following as root:

dpkg --add-architecture i386
apt update
apt install lib32gcc1

Execute the following in a root shell to add the key and repository:

mkdir -p /etc/apt/keyrings/
wget -qO- https://deb1.ws.maxmaton.nl/debian/signing.pub | gpg --dearmor | sudo tee /etc/apt/keyrings/maxmaton.gpg >/dev/null
echo 'deb [signed-by=/etc/apt/keyrings/maxmaton.gpg] http://deb.maxmaton.nl/debian buster main non-free' | sudo tee /etc/apt/sources.list.d/maxmaton.list

After that you can continue with:

apt update
apt install empires-server

When it shows the license agreement, you have to press TAB to put your cursor to OK button.
Your server is now up and running.

You might also need to manually port forward the following ports:

  • UDP 27005
  • TCP and UDP 27015

If you also want the community provided maps, you can install the empires-server-maps-extra package :
Warning!
Takes a long time to install.
This pack is no longer maintained, and has outdated versions of maps.

apt install empires-server-maps-extra

Opening the server console

To open the server console, execute the following command:

su - empires -c "tmux attach"

To get out of the server console, dont do CTRL + C or you will kill the server
You can do CTRL + B and then CTRL + D to detach and get out of server console
You can do CTRL + B and then page up and page down to scroll higher in console, then ESC to get out of the CTRL + B mode (tmux basics, you can google them)

You can also start or stop the empires-server service

service empires-server stop
service empires-server start

Typing quit in server console will automatically restart the server.
When server crashes it will restart automatically. (unless it freezes)

Server folder is located in /var/lib/empires

Start parameters can be edited in /etc/empires-server.conf

More detailed/full start parameters are inside the service /usr/bin/empires-server

Configuration

Cvars

Most configuration can be done through the use of [Server Cvars]. There are several ways commands can be set to run automatically:

  • Include the command in the call to SRCDS. This is how the maxplayers cvar is set in the example above. This will run the command as soon as possible.
  • Include the command in the /cfg/autoexe.cfg file. This will run the command once on server start-up, before any maps have loaded.
  • Include the command in the /cfg/server.cfg file. This will run the command every time any map loads.
  • Include the command in a /cfg/maps/[mapname].cfg file. If there is a .cfg file in this directory with the same name as a map, the commands in it will be run every time that map loads. Use this for map-specific configuration changes, such as adjusting the resource multiplier or ticket count.

The following configuration options are the ones you will most likely need to change:

Common Configuration
Command Description
hostname The name of your server, as it appears in the server browser.
rcon_password A password that can be used to send server commands remotely.
Warning  Warning: Set this to a secure password, and do not share it freely. Anyone with this password can execute admin commands on your server.
sv_password If this is set, players will be required to enter this password before joining the server.
sv_downloadurl The URL of a FastDL server.
sv_region A number representing the region your server is located in. A list of valid regions [can be found here].
sv_contact An email address players can use to contact the server owner.
sv_setsteamaccount Link the server to a Steam account using an authentication token.
~Fixme
Why/under what circumstances should this be done?
maxplayers The maximum number of players allowed to join the server. This can only be set as part of the command that launches SRCDS.

FastDL Setup

The FastDL system allows server owners to specify a URL from which custom content will be downloaded. This speeds up the process of players downloading custom content when joining a server, so setting this system up is highly recommended.


~Fixme
We need instructions here on how to set up a FastDL server.

Server Extensions

There are several plugins available for use in Empires. Two extension systems are available (and can run in parallel):

  • SourceMod is the most common system, and is used for the majority of plugins. Handy SourceMod plugins that have been confirmed to work on Empires servers are:
    • Ungrief Command Vehicle - Teleports the specified command vehicle to where you are looking. Usage: !ungrief <nf | be | imp>
    • SourceBans - A free global administration and banning system for Source engine based servers.
    • Kigen's Anti-Cheat (Requires Sockets 3.0.1 plugin) - An extensive anti-cheating plugin.
    • For more plugins, look at the Sourcemod Plugins page.
  • SourceOp is less popular, but is required to run an anti-DoS plugin:

Both systems themselves run on MetaMod, allowing them to run in parallel.

Tips and Tricks

Customize server.cfg settings

As the server.cfg (amongst others) can be overwritten during upgrade and you may wish to have your server run in different "modes" such as password protected clan match/practice, increased resource rates for "tank wars", etc, it is best to treat your server.cfg as "read-only".

Any default settings you wish to use can be placed in a separate file such as "myserver.cfg". At the end of server.cfg, you can then add the line "exec myserver.cfg".

This way, server.cfg will then run myserver.cfg and override any server.cfg settings.

Loading various server "modes" can then be done by calling them in the server console:

rcon exec tankwars.cfg

If you want a mode to be automatically loaded after map change / server restart, you can add another line to server.cfg below the "exec myserver.cfg" entry.

As an example of custom configuration you might want to use, the following line will disable the ability to join spectators at the start of the round:

emp_allowspectators 0; wait 30000; emp_allowspectators 1

It should be put at the end of the .cfg file so as to not delay any subsequent commands. The wait command delays all further commands by the amount specified in 1/100ths of a second.

Running a beta server

Running a beta server is just like a normal server, with the desired steam branch mentioned when downloading the server package.

steamcmd.exe +login anonymous +app_update 460040 -beta beta validate +quit

See this link for more info on automating server creation, and on switching to specific steam branches. https://developer.valvesoftware.com/wiki/SteamCMD#Automating_SteamCMD

Related Links