Dedicated Server Setup: Difference between revisions

From Empires Wiki
Jump to navigation Jump to search
No edit summary
(24 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{Fixme|This page needs updating with instructions for setting up a server on the source 2013 based version of empires as the below information is incorrect.}}  
{{Sitenav|Dedicated Server Setup}}


{{Sitenav|Dedicated Server Setup}}
== Dedicated Server (Linux) ==
Installing a dedicated server is supported on [https://www.debian.org/CD/netinst/ 32 bit Debian 10]. <br>
Debian 11 has some packages deprecated, this method will not work as described. However you can start with Debian 10 and then later upgrade to 11. <br>
If you have a 64 bit install you might need to execute the following as root: <br>
 
dpkg --add-architecture i386
apt update
apt install lib32gcc1
 
Execute the following in a root shell to add the key and repository:
 
apt install gnupg2
curl https://deb1.ws.maxmaton.nl/debian/signing.pub | apt-key add -
echo 'deb http://deb.maxmaton.nl/debian buster main non-free' > /etc/apt/sources.list.d/maxmaton.list
apt update


== Dedicated Server (Windows) ==
On Debian 10 x64 (maybe even 9) you will also need to add non-free to each repository <br>
{{Warning|'''The information on this page applied to the older source 2007 based version of empires and is no longer correct.'''}}
''(Error: empires-server:i386 : Depends: steamcmd:i386 but it is not installable)'' <br>
There are two ways of installing an Empires dedicated server:
As mentioned here: https://unix.stackexchange.com/questions/390075/install-steamcmd-on-debian-9-stretch <br>
Do
apt edit-sources
And choose your favorite editor and add non-free to each repository <br>
{|
|-
|[[File:Dedicated_server_nonfree.png|600px|thumb|left|Example]]
|-
|}
After that you can continue with:
apt update
apt install empires-server
'''Your server is now up and running.''' <br>
<br>
You might also need to manually port forward <br>
Ports: <br>
UDP 27005 <br>
TCP and UDP 27015 <br>
<br>
If you also want the community provided maps, you can install the empires-server-maps-extra package (warning, takes a long time to install):


*Using [https://developer.valvesoftware.com/wiki/SteamCMD SteamCMD].
apt install empires-server-maps-extra


*Using [http://didrole.com/UpdateTool/ Didrol's update tool]. For the rest of this setup tutorial, we will assume we use this tool.
=== Opening the server console ===
To open the server console, execute the following command:


{{Note|If updating multiple instances, you will need to apply this for each one. That means running the tool against more than one directory: "C:\****\Empires Main Server"; "C:\****\Empires Test Server"; or wherever your instances are. Open notepad andcopy and paste so there are no typo's.}}
su - empires -c "tmux attach"


=== Download Tool ===
To get out of the server console, dont do CTRL + C or you will kill the server <br>
You can do CTRL + B and then CTRL + D to detach and get out of server console <br>
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>


You can download the tool [http://didrole.com/UpdateTool/UpdateTool-0.3.rar here].
Server folder is located in /var/lib/empires


*After downloading, extract the RAR.
You can also start or stop the empires-server service
service empires-server stop
service empires-server start


=== Downloading Empires ===
== Dedicated Server (Windows) ==


*Download and install (follow the instructions on the page): [https://developer.valvesoftware.com/wiki/SteamCMD SteamCMD].
*Open a command line window with elevated / local administrator privileges and browse to the location of the update tool.
*Open a command line window with elevated / local administrator privileges and browse to the location of the update tool.
*Update syntax example:
*Update syntax example:
<pre>
updatetool.exe -command update / install -game 17740
-dir "C:\Folder Path to Empires\" -username SteamUsername -password SteamPassword -verify_all
</pre>


*-command update - Tells the tool you are updating an existing server.
*-command install - Tells the server you are installing a new server.
*-game 17740 - Tells the server the Steam AppID. In the case of Empires you need to use "17740".
*-dir - This is the installation path to the Empires Server files. It is probably worth noting that for the author of this tutorial, it was "C:\*****\Empires\orangebox" .
{{Warning|It is very important that you use a full local file path & wrap it with quotation marks to help it parse any spaces. Use an existing path in conjuction with "-command update" or a new path in conjunction with "-command install".}}
*-username SteamUsername - Where Username is the Steam account you will use to connect to Steam and download the files. It is a good idea to have a separate account set up for this.
*-password SteamPassword - Self explanatory.
*-verify_all - This will verify all the files once they have been installed. Highly recommended.
{{Warning|If you have not verified the Steam account you are using to update / install your server, an e-mail will be sent with a Steam verification code to the registered primary e-mail account. In this case, you will need to run the same command again but include the verification code by adding this switch:}}
<pre>
<pre>
-steam_guard_code 5char
steamcmd.exe +login anonymous +app_update 460040 validate +quit
</pre>
</pre>
Where "5char" is replaced by the verification code Steam will e-mail.


Original author: A-z-K
*to update Empires Dedicated Server follow the same procedure.


== Dedicated Server (Linux) ==
Installing a dedicated server is supported on Debian 8. Execute the following in a root shell:
apt-get install curl ca-certificates lib32gcc1
adduser --system --group --home /var/lib/empires empires --shell /bin/bash
su - empires
mkdir Steam
cd Steam
wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz
tar -xzf steamcmd_linux.tar.gz
cat > ../update <<UPDATE
login anonymous
force_install_dir steamapps/common/empires_dedicated/
app_update 460040 validate
quit
UPDATE
./steamcmd.sh +runscript ../update
cd steamapps/common/empires_dedicated
cat > run <<RUN
#!/bin/sh
~/Steam/steamapps/common/empires_dedicated/srcds_run -game empires -secure -steam -dev -steam_dir ~/Steam/ -steamcmd_script ../update -autoupdate -maxplayers 62 +map emp_district
RUN
chmod +x run
./run


== Server Extensions ==
== Server Extensions ==
Line 104: Line 104:
</pre>
</pre>


It should be put at the end of the .cfg file so as to not delay any subsequent commands. The value after the wait command delays all further commands by the amount specified in 1/100ths of a second.
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>
steamcmd.exe +login anonymous +app_update 460040 -beta beta validate +quit
</pre>
 
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.sourcemod.net/ SourceMod]
* [http://www.sourcemod.net/ SourceMod]
* https://pastebin.com/SXsp0r2F

Revision as of 23:46, 28 April 2022

Home > Dedicated Server Setup

Dedicated Server (Linux)

Installing a dedicated server is supported on 32 bit Debian 10.
Debian 11 has some packages deprecated, this method will not work as described. However you can start with Debian 10 and then later upgrade to 11.
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:

apt install gnupg2
curl https://deb1.ws.maxmaton.nl/debian/signing.pub | apt-key add -
echo 'deb http://deb.maxmaton.nl/debian buster main non-free' > /etc/apt/sources.list.d/maxmaton.list
apt update

On Debian 10 x64 (maybe even 9) you will also need to add non-free to each repository
(Error: empires-server:i386 : Depends: steamcmd:i386 but it is not installable)
As mentioned here: https://unix.stackexchange.com/questions/390075/install-steamcmd-on-debian-9-stretch
Do

apt edit-sources

And choose your favorite editor and add non-free to each repository

Example

After that you can continue with:

apt update
apt install empires-server

Your server is now up and running.

You might also need to manually port forward
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):

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)

Server folder is located in /var/lib/empires

You can also start or stop the empires-server service

service empires-server stop
service empires-server start

Dedicated Server (Windows)

  • Download and install (follow the instructions on the page): SteamCMD.
  • Open a command line window with elevated / local administrator privileges and browse to the location of the update tool.
  • Update syntax example:
steamcmd.exe +login anonymous +app_update 460040 validate +quit
  • to update Empires Dedicated Server follow the same procedure.


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