Source Dedicated Server: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
{{toc-right}}
{{toc-right}}


The '''Source Dedicated Server''' or '''srcds''' (or just '''DS''') is a tool that runs the server component of a Source game without the client component. In other words, it simulates the game without drawing it. The DS is chiefly used by server providers who want to serve up as many games from the same computer as they can.
The '''Source Dedicated Server''' or '''SRCDS''' is a tool that runs the server component of a Source game without the client component. In other words, it simulates the game without drawing it. SRCDS is chiefly used by server providers who want to serve up as many games from the same computer as they can.


This page, however, is aimed at mod developers who want to run srcds on their home computer. Doing this is a must if you are creating a multiplayer mod as the behaviour of dedicated servers differs from that of listenservers (those started from the main menu) in some areas. Crashes that only happen on a DS are entirely possible!
This page, however, is aimed at mod developers who want to run SRCDS on their home computer. Doing this is a must if you are creating a multiplayer mod as the behaviour of dedicated servers differs from that of listenservers (those started from the main menu) in some areas. Crashes that only happen on a dedicated server are entirely possible!


== Connectivity ==
== Connectivity ==
No matter which type of server you are using, your computer must be able to receive unsolicited incoming connections. This is exactly what routers and software firewalls exist to prevent, so if you are using either you will have to reconfigure. Refer to the manufacturer instructions for how to do this.
No matter which type of server you are using, your computer must be able to receive unsolicited incoming connections. This is exactly what routers and software firewalls exist to prevent, so if you are using either you will have to reconfigure. Refer to the manufacturer instructions for how to do this.


The ports srcds officially requires are:
The ports SRCDS officially requires are:


* 27015 TCP/UDP (game transmission, pings and [[RCON]])
* 27015 TCP/UDP (game transmission, pings and [[RCON]])
* 27020 UDP ([[SourceTV]] transmission)
* 27020 UDP ([[SourceTV]] transmission)


It has also been spotted opening connections on 27005 and 51840 UDP, but these may be outbound only.
SRCDS has also been spotted opening connections on 27005 and 51840 UDP, but these may be outbound only.


{{tip|1=Pinging your own server will fail with some routers and/or ISPs. The most reliable way to test whether your connection is open is either to get a friend to try connecting, or to install the [http://www.microsoft.com/downloads/details.aspx?FamilyID=983b941d-06cb-4658-b7f6-3088333d062f Microsoft Network Monitor] (apply the filter <code>Udp.Port == 27015</code>) and watch for requests coming in from random people around the world. Note that the heartbeats you will see being sent to the two master servers do not mean that the connection is open.}}
{{tip|1=Pinging your own server will fail with some routers and/or ISPs. The most reliable way to test whether your connection is open is either to get a friend to try connecting, or to install the [http://www.microsoft.com/downloads/details.aspx?FamilyID=983b941d-06cb-4658-b7f6-3088333d062f Microsoft Network Monitor] (apply the filter <code>Udp.Port == 27015</code>) and watch for requests coming in from random people around the world. Note that the heartbeats you will see being sent to the two master servers do not mean that the connection is open.}}
{{tip|If you've opened and forwarded the correct ports and still can't receive connections, the panic button on many routers is DMZ ('Demilitarised Zone') mode. This removes all security entirely, including [[w:Denial-of-service attack|DOS]] protection, and sends all unsolicited traffic to a specified computer. ''Make sure your software and OS are all up to date before you do this.''}}


{{note|A residential internet connections may not have the upload capacity to support large games.}}
{{note|A residential internet connections may not have the upload capacity to support large games.}}


== Setting up ==
== Setting up ==
 
{{note|The Source 2006 dedicated server has been removed from Steam, leaving only the Source 2009 version (its GCF says 2007, but don't be fooled). Mods, whether for 2006 or 2007, can now only be run from SRCDS installs. Errors about "SetupArrayProps_R" will appear if you mix versions.}}
:''The Source 2006 DS has been removed from Steam, leaving only the Source 2009 version (its GCF says 2007, but don't be fooled). Mods, whether for 2006 or 2007, can now only be run from HLDS installs. Errors about "SetupArrayProps_R" will appear if you mix versions.''
{{note|The HLDS Update Tool does not provide [[Lost Coast]], even though [[SDK Base]] does. Multiplayer mods should either not use anything from Lost Coast, or include what they do use in their dedicated server download.}}


Administering a dedicated server is exactly the same as administering a listenserver. Setting it up is quite different however.
Administering a dedicated server is exactly the same as administering a listenserver. Setting it up is quite different however.


#Install the [[HLDSUpdateTool]] or [[SteamCMD]] for newer games such as [[Counter-Strike: Global Offensive|CS:GO]].
#Install the [[HLDSUpdateTool]] or [[SteamCMD]] for newer games such as [[Counter-Strike: Global Offensive|CS:GO]].
# '''Run the update tool with <code>-command update -game orangebox</code>'''. Optionally, add <code>-dir <path></code> to download to a custom location.
# Run the update tool with <code>-command update -game orangebox</code>. Optionally, add <code>-dir <path></code> to download to a custom location.
# Unless you actually want to download everything again, '''cancel the tool with {{key|Ctrl+C}}''' once it starts on materials. You can skip the bulk of the downloading by extracting the GCFs already on your system with [[GCFScape]] instead.
# Unless you actually want to download everything again, '''cancel the tool with {{key|Ctrl+C}}''' once it starts on materials. You can skip the bulk of the downloading by extracting the GCFs already on your system with [[GCFScape]] instead.
#* You will need to '''extract sounds, materials and models'''; do the "source X" GCFs before the "source 2007 X" ones.
#* You will need to '''extract sounds, materials and models'''; do the "source X" GCFs before the "source 2007 X" ones.
Line 38: Line 35:
[http://youtu.be/qv5jE8FWd_A Video Tutorial for setup on Windows]
[http://youtu.be/qv5jE8FWd_A Video Tutorial for setup on Windows]


{{warning|The HLDS update tool does not provide [[Lost Coast]], even though [[SDK Base]] does. Multiplayer mods should either not use anything from Lost Coast, or include what they do use in their dedicated server download.}}
{{bug|A Steam TF2 dedicated server will not load correctly if its game folder is anywhere other than <code><server dir>\tf\</code>. Don't copy your custom content over to fix this: instead, create a [http://technet.microsoft.com/en-us/library/cc753194%28WS.10%29.aspx symbolic link].}}
 
{{bug|A Steam TF2 DS will not load correctly if its game folder is anywhere other than <code><server dir>\tf\</code>. Don't copy your custom content over to fix this: [http://technet.microsoft.com/en-us/library/cc753194%28WS.10%29.aspx instead, create a symbolic link].}}


{{tip|You can pass console commands as command line parameters with '+'. e.g. <code>+map my_map</code>.}}
{{tip|You can pass console commands as command line parameters with '+'. e.g. <code>+map my_map</code>.}}

Revision as of 11:24, 3 September 2012

The Source Dedicated Server or SRCDS is a tool that runs the server component of a Source game without the client component. In other words, it simulates the game without drawing it. SRCDS is chiefly used by server providers who want to serve up as many games from the same computer as they can.

This page, however, is aimed at mod developers who want to run SRCDS on their home computer. Doing this is a must if you are creating a multiplayer mod as the behaviour of dedicated servers differs from that of listenservers (those started from the main menu) in some areas. Crashes that only happen on a dedicated server are entirely possible!

Connectivity

No matter which type of server you are using, your computer must be able to receive unsolicited incoming connections. This is exactly what routers and software firewalls exist to prevent, so if you are using either you will have to reconfigure. Refer to the manufacturer instructions for how to do this.

The ports SRCDS officially requires are:

  • 27015 TCP/UDP (game transmission, pings and RCON)
  • 27020 UDP (SourceTV transmission)

SRCDS has also been spotted opening connections on 27005 and 51840 UDP, but these may be outbound only.

Tip.pngTip:Pinging your own server will fail with some routers and/or ISPs. The most reliable way to test whether your connection is open is either to get a friend to try connecting, or to install the Microsoft Network Monitor (apply the filter Udp.Port == 27015) and watch for requests coming in from random people around the world. Note that the heartbeats you will see being sent to the two master servers do not mean that the connection is open.
Note.pngNote:A residential internet connections may not have the upload capacity to support large games.

Setting up

Note.pngNote:The Source 2006 dedicated server has been removed from Steam, leaving only the Source 2009 version (its GCF says 2007, but don't be fooled). Mods, whether for 2006 or 2007, can now only be run from SRCDS installs. Errors about "SetupArrayProps_R" will appear if you mix versions.
Note.pngNote:The HLDS Update Tool does not provide Lost Coast, even though SDK Base does. Multiplayer mods should either not use anything from Lost Coast, or include what they do use in their dedicated server download.

Administering a dedicated server is exactly the same as administering a listenserver. Setting it up is quite different however.

  1. Install the HLDSUpdateTool or SteamCMD for newer games such as CS:GO.
  2. Run the update tool with -command update -game orangebox. Optionally, add -dir <path> to download to a custom location.
  3. Unless you actually want to download everything again, cancel the tool with Ctrl+C once it starts on materials. You can skip the bulk of the downloading by extracting the GCFs already on your system with GCFScape instead.
    • You will need to extract sounds, materials and models; do the "source X" GCFs before the "source 2007 X" ones.
    • You should end up with <server_path>\hl2 from your GCFs and <server_path>\orangebox from the update tool.
    • You may want to run the update tool again after extracting to make sure that everything is correct.
  4. To start the server, run orangebox\srcds.exe -console -game <vproject>.

Video Tutorial for setup on Windows

Icon-Bug.pngBug:A Steam TF2 dedicated server will not load correctly if its game folder is anywhere other than <server dir>\tf\. Don't copy your custom content over to fix this: instead, create a symbolic link.  [todo tested in ?]
Tip.pngTip:You can pass console commands as command line parameters with '+'. e.g. +map my_map.

See Also

External Links