Raised This Month: $206 Target: $400
 51% 

Dota 2 Dedicated Servers


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DS
SourceMod Developer
Join Date: Sep 2004
Location: WI, USA
Old 03-08-2014 , 15:44   Dota 2 Dedicated Servers
Reply With Quote #1

It is now possible to run dedicated servers for Dota 2 on all platforms: Windows, Linux, and Mac OS X.

Installation

To get started, download Dota 2 using the Steam client or SteamCMD with appid 570. For SteamCMD, you will have to login to an existing Steam account since it is not available when logging in anonymously.

For Mac OS X, follow the Linux instructions for SteamCMD usage. The Mac OS X build of SteamCMD can be downloaded here.

Next, download the appropriate attachment below for the OS on which you wish to run a server. Extract the files into your Dota 2 install directory. Note that this will overwrite the dedicated.so or dedicated.dylib file on Linux or OS X.

By default, the install directory will be one of the following:
  • Windows: C:\Program Files (x86)\Steam\SteamApps\common\dota 2 beta
  • Linux: ~/.local/share/Steam/SteamApps/common/dota 2 beta
  • Mac OS X: ~/Library/Application Support/Steam/SteamApps/common/dota 2 beta
For Linux, if you don't have the Steam client installed, you will also need to download the Steam runtime and extract it into your home directory.

For both Linux and Mac OS X, if you don't have the Steam client installed, you will need to still obtain the steamclient binaries from a Steam client install for your OS and copy them to the bin directory of your Dota 2 install. This includes crashhandler, steamclient, libsteam, libtier0_s, and libvstdlib_s. On Linux, these files have a .so extension and can be found in ~/.steam/bin32. On OS X, they have a .dylib extension and can be found in /Applications/Steam.app/Contents/MacOS/osx32. From /Applications/Steam.app/Contents/MacOS, you will also need to copy the Frameworks directory to your server's install directory (NOT bin).

Before you run the server, it is highly recommended that you also install the latest snapshot of Metamod:Source and the Dota 2 Fixups plugin in order to fix a number of issues. Note that you must edit the gameinfo.txt file in the "dota" subdirectory in order to install Metamod:Source. For more details on this install method, see the documentation here. (If you chose to use a Steam client install from which you also play the game, you will need to remove the gameinfo edit before launching the Dota client.)

Running the Server

After installing the necessary files, running the server is easy if you've ever run Source servers before. Open a terminal program (or the command prompt on Windows) and navigate to the directory containing your Dota 2 installation. Then run the following command depending on which OS you are using:
  • Windows: srcds.exe -console -game dota +map dota
  • Linux: ~/steam-runtime/run.sh ./srcds_run -game dota +map dota
  • Mac OS X: ./srcds_run -game dota +map dota
Additional command line options, such as -port <port number> and -ip <ip address>, may also be added as needed.

If on Linux and using the copy of steam-runtime shipped with the Steam client, its default path is ~/.steam/bin32/steam-runtime.


Special thanks to psychonic for testing this on Linux and for creating the Dota 2 Fixups plugin!
Attached Files
File Type: zip dota2-srcds-windows.zip (36.9 KB, 13018 views)
File Type: gz dota2-srcds-linux.tar.gz (168.2 KB, 1253 views)
File Type: gz dota2-srcds-osx.tar.gz (133.2 KB, 336 views)

Last edited by psychonic; 11-25-2014 at 23:03. Reason: Update linux and mac packages with port bind fix
DS is offline
diego91
New Member
Join Date: Feb 2014
Old 03-10-2014 , 04:48   Re: Dota 2 Dedicated Servers
Reply With Quote #2

hi
what I need to edit in gameinfo.txt ?
when I start the server it shuts down
srcds.exe -console -game dota +map dota +ip x.x.x.x -port xxxxx
(windows)

"GameInfo"
{
game "DOTA 2"
gamelogo 1
type multiplayer_only
nomodels 1
nohimodel 1
nocrosshair 0
GameData "dota.fgd"
SupportsDX8 0


FileSystem
{
SteamAppId 816 // This will mount all the GCFs we need (240=CS:S, 220=HL2).
ToolsAppId 211 // Tools will load this (ie: source SDK caches) to get things like materials\debug, materials\editor, etc.

//
// The code that loads this file automatically does a few things here:
//
// 1. For each "Game" search path, it adds a "GameBin" path, in <dir>\bin
// 2. For each "Game" search path, it adds another "Game" path in front of it with _<langage> at the end.
// For example: c:\hl2\cstrike on a french machine would get a c:\hl2\cstrike_french path added to it.
// 3. For the first "Game" search path, it adds a search path called "MOD".
// 4. For the first "Game" search path, it adds a search path called "DEFAULT_WRITE_PATH".
//

//
// Search paths are relative to the base directory, which is where hl2.exe is found.
//
// |gameinfo_path| points at the directory where gameinfo.txt is.
// We always want to mount that directory relative to gameinfo.txt, so
// people can mount stuff in c:\mymod, and the main game resources are in
// someplace like c:\program files\valve\steam\steamapps\<username>\half-life 2.
//
SearchPaths
{
Game |gameinfo_path|.
Game platform
}
}
}

Last edited by diego91; 03-10-2014 at 04:52.
diego91 is offline
psychonic

BAFFLED
Join Date: May 2008
Old 03-10-2014 , 11:14   Re: Dota 2 Dedicated Servers
Reply With Quote #3

Quote:
Originally Posted by diego91 View Post
what I need to edit in gameinfo.txt ?
The SearchPaths sections should look like this after you add the GameBin line documented here, https://wiki.alliedmods.net/Installi...ource#GameInfo

Code:
        SearchPaths
        {
            GameBin            |gameinfo_path|addons/metamod/bin
            Game            |gameinfo_path|.
            Game            platform
        }
psychonic is offline
Tetl
Member
Join Date: Nov 2009
Old 03-10-2014 , 20:31   Re: Dota 2 Dedicated Servers
Reply With Quote #4

Alright!!! So there's a lot of confusion on here and elsewhere on how to run a Dota 2 server of your own, here's a complete(hopefully) rundown:

What you need:
steamcmd
The latest Metamod:Source 1.11 Snapshot.
The latest download of d2fixups.


Installation:
You'll use steamcmd to install and maintain your Dota installation. Follow these instructions using Dota's appid of 570. So, when you see commands like:
PHP Code:
app_update 740 validate 
Know that the Dota equivalent is:
PHP Code:
app_update 570 validate 
I'll refer to the root of your steamcmd install as "dotaserver"

You'll need a compatible srcds executable for your platform. Get it from DS's original post in this thread above. Extract it into "/dotaserver/", putting the core files (e.g. srcds_linux, srcds.exe) alongside your Dota exectuable.

Open up your steamcmd install to the (dotaserver/dota) directory.
Metamod:Source goes inside your addons folder. If you look inside of the .rar, you'll see an "addons" folder. This means that it's meant to be merged with your existing addons folder, so drop it inside of dotaserver/dota directly.
d2fixups is the same way. After extracting MM:S, extract d2fixups just like that.

To get Metamod:Source to load, you need to edit gameinfo.txt in (dotaserver/dota) as per the instruction in this article under "GameInfo".

Launching srcds
You'll need to run the program with certain parameters. DS's original post brushes over the specifics of executing SRCDS on your platform.

Mandatory:
PHP Code:
 -game dota -console 
Sub-Mandatory:
PHP Code:
 -port <port> -ip <computersLANIP
Helpful:
PHP Code:
 +map <mapname> -maxplayers 10 +developer <0/1/2
Network and General Configuration in Windows
In Windows, I like creating a shortcut and editing its "target". This involves creating a shortcut to srcds.exe, opening Right click-> Properties, and adding your parameters after the final quotation mark in the Target: field. You'll need these, for sure:
-console -game dota +map dota -maxplayers 10 -port <yourchosenport> -ip <computersLANIP>
So, my Target: field looks something like this:
"C:\dotaserver\srcds.exe" -console -game dota -port 3003 -ip 192.168.1.4 -maxplayers 10

For -ip, input your computer's LAN address. Windows users can find out how here:
http://windows.about.com/od/networkc...-Windows-7.htm

Pick any available port for -port. Keep in mind that in addition to any typical networking considerations (firewalls, etc.), if you want to make your server joinable over the network, you need to forward your chosen port. Find your router on this list., and pick a guide for any game. Then, just apply the instructions given, but for whatever port you've chosen.

Connecting and Playing
To connect clients must enter
Code:
connect ip:port
into their Dota console, example:
Code:
connect 192.168.1.4:27015
When greeted with a darkened overview of the map, you need only to join a team.
Code:
jointeam good
Code:
jointeam bad
To skip the Waiting For Players stage, set the following cvar:
Code:
dota_wait_for_players_to_load 1
where the integer is the number of players to wait for before entering Pick.

Last edited by Tetl; 08-05-2015 at 01:50. Reason: fixing tet's stuff
Tetl is offline
CyberStars
Senior Member
Join Date: May 2013
Old 03-14-2014 , 04:18   Re: Dota 2 Dedicated Servers
Reply With Quote #5

Thanks a lot for this. It's really cool
Actually, I have some problems running the server.
After installing and configuring the server according above instructions, I run it.
But it writes:
********************************************* ***
* Unable to load Steam support library. *
* This server will operate in LAN mode only. *
********************************************* ***

How to fix this???

P.S.
How to use Sourcemod for this server?

Last edited by CyberStars; 03-14-2014 at 05:31.
CyberStars is offline
psychonic

BAFFLED
Join Date: May 2008
Old 03-14-2014 , 09:34   Re: Dota 2 Dedicated Servers
Reply With Quote #6

Quote:
Originally Posted by CyberStars View Post
Thanks a lot for this. It's really cool
Actually, I have some problems running the server.
After installing and configuring the server according above instructions, I run it.
But it writes:
********************************************* ***
* Unable to load Steam support library. *
* This server will operate in LAN mode only. *
********************************************* ***

How to fix this???
Oops! There is an extra step required if you do not have the Steam client installed. I've updated the first post with it.

Quote:
Originally Posted by psychonic View Post
For both Mac and Linux, if you don't have the Steam client installed, you will need to still obtain the steamclient binaries from a Steam client install for your OS and copy them to bin directory of your Dota 2 install. This includes steamclient, libsteam, libtier0_s, and libvstdlib_s. On Mac, they have a .dylib extension and can be found in /Applications/Steam.app/Contents/MacOS/osx32. On Linux, they have a .so extension and can be found in ~/.steam/bin32.

Quote:
Originally Posted by CyberStars View Post
P.S.
How to use Sourcemod for this server?
Same as on Windows - just grab a Linux snapshot from the download page instead of a Windows snapshot.

Last edited by psychonic; 03-14-2014 at 09:35.
psychonic is offline
CyberStars
Senior Member
Join Date: May 2013
Old 03-14-2014 , 10:37   Re: Dota 2 Dedicated Servers
Reply With Quote #7

Quote:
Originally Posted by psychonic View Post
For both Mac and Linux, if you don't have the Steam client installed, you will need to still obtain the steamclient binaries from a Steam client install for your OS and copy them to bin directory of your Dota 2 install. This includes steamclient, libsteam, libtier0_s, and libvstdlib_s. On Mac, they have a .dylib extension and can be found in /Applications/Steam.app/Contents/MacOS/osx32. On Linux, they have a .so extension and can be found in ~/.steam/bin32.
This helped. Solved the issue. Thanks a lot.

Quote:
Originally Posted by psychonic View Post
Same as on Windows - just grab a Linux snapshot from the download page instead of a Windows snapshot.
For Sourcemod: it isn't loaded.
the result of "meta list" is
Listing 2 plugins:
[01] <ERROR>
[02] Dota 2 Fixups (2.0.0) by Nicholas Hastings

Last edited by CyberStars; 03-14-2014 at 10:38.
CyberStars is offline
psychonic

BAFFLED
Join Date: May 2008
Old 03-14-2014 , 10:39   Re: Dota 2 Dedicated Servers
Reply With Quote #8

Quote:
Originally Posted by CyberStars View Post
For Sourcemod: it isn't loaded.
the result of "meta list" is
Listing 2 plugins:
[01] <ERROR>
[02] Dota 2 Fixups (2.0.0) by Nicholas Hastings
What prints if you type this in console:
Code:
meta load addons/sourcemod/bin/sourcemod_mm

Last edited by psychonic; 03-14-2014 at 10:39.
psychonic is offline
CyberStars
Senior Member
Join Date: May 2013
Old 03-14-2014 , 10:57   Re: Dota 2 Dedicated Servers
Reply With Quote #9

Quote:
Originally Posted by psychonic View Post
What prints if you type this in console:
Code:
meta load addons/sourcemod/bin/sourcemod_mm
Failed to load plugin addons/sourcemod/bin/sourcemod_mm (/home/user/dota2/dota/addons/sourcemod/bin/sourcemod_mm_i486.so: undefined symbol: _ZTVN10__cxxabiv117__class_type_infoE).

SM_version: 1.6.0-hg4283

Last edited by CyberStars; 03-14-2014 at 11:11.
CyberStars is offline
CyberStars
Senior Member
Join Date: May 2013
Old 03-14-2014 , 11:28   Re: Dota 2 Dedicated Servers
Reply With Quote #10

Quote:
Originally Posted by psychonic View Post
What prints if you type this in console:
Code:
meta load addons/sourcemod/bin/sourcemod_mm
The same error message for SM version 1.6.0-hg4284
CyberStars is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:05.


Powered by vBulletin®
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Theme made by Freecode