Dedicated Server Setup: Difference between revisions

From Empires Wiki
Jump to navigation Jump to search
(47 intermediate revisions by 10 users not shown)
Line 2: Line 2:


== Dedicated Server (Windows) ==
== Dedicated Server (Windows) ==
=== 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.
*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.
*Update syntax example:


=== Installing ===
<pre>
* 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:
steamcmd.exe +login anonymous +app_update 460040 validate +quit
C:\HL2DS
</pre>
* 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 
*to update Empires Dedicated Server follow the same procedure.


* 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.
== Dedicated Server (Linux) ==
Installing a dedicated server is supported on Debian 9. Execute the following in a root shell:


{{Tip|Make sure you replace C:\HL2DS with your install path if it's different.}}
apt 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


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
== Server Extensions ==
There are several plugins available for use in Empires. Two extension systems are available (and can run in parallel):
* [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:
** [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.


* Install the Empires Dedicated Server files to "C:\HL2DS\empires" (use your own install path).
Both systems themselves run on [http://www.sourcemm.net/ MetaMod], allowing them to run in parallel.
* 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:
-game empires +maxplayers 14 -port 27015 -console +map emp_canyon -autoupdate
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 ===
== Tips and Tricks ==
Next, edit your mapcycle.txt and server.cfg files to your liking.
=== Customize server.cfg settings ===
{{Warning|When editing your server.cfg remember to change your '''rcon_password''' and '''hostname''' directives!}}
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".
rcon_password "pass" //Your rcon password
hostname "Servername" //The name of your server


These are the most important settings to change, there are more in the cfg so test around what is best for you.
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".


=== Starting ===
This way, server.cfg will then run myserver.cfg and override any server.cfg settings.
You should now be able to double-click your server shortcut, which will start up your dedicated server.


== Dedicated Server (Linux) ==
Loading various server "modes" can then be done by calling them in the server console:
=== Downloading ===
 
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].
<pre>
rcon exec tankwars.cfg
</pre>
 
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:


=== Installing SDS ===
<pre>
Now we have to extract the HLDS-Update-Tool.
emp_allowspectators 0; wait 30000; emp_allowspectators 1
* Go to the homedir of the user who is designated to run the HL2-Server and create a subdir.
</pre>
hl2usr@hl2srv ~ # mkdir hl2
* Copy the HLDS-Update-Tool into your new subdir and chmod it to make it executable:
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 ===
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.
Next, we have to extract the previously downloaded Empires-Server.
* 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 created a subdir ''orangebox/empires'' and extracted all needed files into it.


=== Configuration ===
== Running a beta server ==
Before you can start your new Dedicated Server the servers config files have to be altered to satisfy your needs.
Running a beta server is just like a normal server, with the desired steam branch mentioned when downloading the server package.
* 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 ===
Now your server should be ready for startup
* cd to your Dedicated-Servers basedir (''~/hl2'' in this example)
* 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>
<pre>
#! /bin/bash
steamcmd.exe +login anonymous +app_update 460040 -beta beta validate +quit
screen -A -d -m -S empires -t empires ./srcds_run -game empires +maxplayers 14 -port 27015 -console +map emp_canyon -autoupdate
</pre>
</pre>
}}
 
* Now make the Bash-File executable and run it:
See this link for more info on automating server creation, and on switching to specific steam branches.
hl2usr@hl2srv ~/hl2 # chmod +x empires.sh
https://developer.valvesoftware.com/wiki/SteamCMD#Automating_SteamCMD
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


== 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

Revision as of 23:36, 3 January 2018

Home > Dedicated Server Setup

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.

Dedicated Server (Linux)

Installing a dedicated server is supported on Debian 9. Execute the following in a root shell:

apt 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

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