ThirdBlog-Top

Thursday, July 2, 2015

Mounting content on a DS

Mounting Content on a DS

You might want to include maps from Counter-Strike or Team Fortress on your server. Updating and copying the maps over can be a pain.

mount.cfg

With mount.cfg you can specify folders to add to the filesystem. Garry's Mod will scan the file, mount the folders and any vpk files inside that folder.

mount.cfg is located in garrysmod/cfg/ - and should look something like this:


 "mountcfg"
 {
                "cstrike"               "C:\steamcmd\steamapps\common\Counter-Strike Source Dedicated Server\cstrike"
                "tf"                         "C:\mytf2server\tf"
 }

Note: Linux paths cannot contain capital letters

If you are on Linux and your games do not mount, make sure your directories do not contain capital letters like so:

 "mountcfg"
 {
                "tf"                         "/opt/team fortress 2 dedicated server/tf"
                "episodic"                           "/home/gmod/steam/steamapps/common/half-life 2/episodic" //HL2 Episode 1
 }

mountdepots.txt

There is currently a bug with dedicated servers where the function IsMounted returns the wrong value. If you are experiencing:

The flechette gun has a broken viewmodel and isn't firing projectiles correctly.
Your clients are unable to spawn Hunters or NPCs from Half-Life: Source
Spawning the Jalopy doesn't do anything.
Then you may need to ensure mountdepots.txt exists in garrysmod/cfg/ with contents resembling:

 "gamedepotsystem"
 {
                "cstrike"               "1"
                "hl1"                      "1"
                "hl1_hd"              "1"
                "hl2"                      "1"
                "hl2mp"                               "1"
                "episodic"           "1"
                "ep2"                    "1"
                "lostcoast"          "1"
 }



Retrieving content to be mounted on a Dedicated Server

General Requirements

To be able to install Episode 1 / 2 / Portal / Other content on a Garrysmod DS, there are a few requirements, these are:

The game must be using the Steam Pipe format and be available on SteamCMD.
You have access to a copy of the game legally via a Steam account.
For our example, we'll be using Half Life 2: Episode Two

Step One

For content such as TF2, CSS and so on just Launch SteamCMD and type in login anonymous.

If you're after content such as EP2 or EP1 (Singleplayer Valve games in general), Launch SteamCMD and type in "login <username>'. Make sure that this Steam Account has the game on the account otherwise you will be greeted with a No Access error.

When you login with an actual username, it will ask for a password (which will appear as plaintext in the console). If you have Steam Guard enabled, it will then ask for a verification code.

Step Two

As you would with your typical SteamCMD server, perform the app_update command. For Episode Two this is 420, so "app_update 420".

Step Three

Assuming all has gone well, the content will start downloading to the directory specified. The content will already be in Steampipe format so no converting has to be done.

Using the mounts.cfg file we can then set content path with the appropriate tag. Once this is done, reboot the server and the content should be working and available for users.

GSP / Multiple Server tips

If you install the content to a single location (such as C:\BaseContent) and then point all the mount files to that one location, every single server is able to mount from that one directory. No longer do you have to ship content with each server
To upgrade any online content (CSS, TF2 etc) for Garrysmod, just have SteamCMD point to that folder each time and it will perform the incrimental updates. That way you don't have to faff on each time.
The user you are running your servers with only needs (R)ead permissions on those content folders.

See also


List of SteamPipe games and IDs

1 comment:

  1. Awesome and interesting article. Great things you've always shared with us. Thanks. Just continue composing this kind of post. hong kong dedicated server

    ReplyDelete