SRCDS Steam group


Correct SV_DOWNLOADURL HOW TO!!!!!
#1
Setting up your Source Dedicated Server and Apache to serve custom maps to players.

      This guide is for a Counter-Strike: Source dedicated server running on a Linux distro (mine is Redhat ES 3) and using Apache2 web server. If you want to use an existing Apache web server on your Linux box, you will have to have your own domain name (they are cheap at godaddy.com) or you will have to use another site somewhere that you will have access to web site file structure.
      
      Some things you will need on your server are: bzip2 a compression program to compress the bsp and any asset files like sounds, models, etc... that are too large. Any files that are over a couple of Megs I would bzip them. You will need an ftp program so you can put your files on the web server.
      
      Here we go, for an example I will be documenting my installation of the custom map “cs_office_extended”. This is one of the easier ones since the author was knowledgeable enough to put everything in the correct directories in the archive file and also included a resource file (very important). I have had to create resource files for other custom maps that I have downloaded since the author of those maps did not include one.  After you read this guide you to will be able to do the same if you run across a custom map that did not include one. Also, if you are running bots on your server like I am, you will also need the .nav file. I have seen some maps that did not include a nav file and so I did not mess with them since a nav file is very complex to create and you need the map source since it is done in the hammer editor. Anyway let’s get started.
      
      I downloaded the archive file for cs_office_extended to my WinXP machine and extracted the files in a directory. The directory structure looks like this:
      cs_office_extended
      - - maps
      - - materials
      - - - - cs_office_extended
      - - - - - - decals
      - - - - - - plaster
      
      The maps folder includes the cs_office_extended.bsp, cs_office_extended.nav, files and the cs_office_extended.txt file that is used on the map start page. The materials folder contains the cs_office_extended folder, that containing the decals, and plaster folders. The decals folder contains a couple of custom decals the map authors made. The plaster folder contains another custom material for the map. The cs_office_extended.res file should go in the cstrike folder on the web server so the game knows where the assets are located. I have seen other tutorials say to put that file in the maps directory but if you do on the webserver the clients connecting will not be able to download the map. I have tested this so trust me.
      
      The cs_office_extended.res file is worth looking at since if you run across a custom map you want to put on your server and it doesn’t have one, you will be able to create one for it from scratch. Here is what this one looks like:
      "resources"
      {
      "materials/cs_office_extended/decals/SIGslide.vmt" "file"
      "materials/cs_office_extended/decals/SIGslide.vtf" "file"
      "materials/cs_office_extended/plaster/SIGslide.vmt" "file"
"maps/cs_office_extended.bsp.bz2" "file"
"maps/cs_office_extended.nav" "file"
      }
      
      This not only tells the game where to download them from but where to put them in the client directory also. You then need to transfer everything in the maps folder to the maps folder in your game server cstrike/maps folder, transfer the cs_office_extended folder and all its contents to the game server cstrike/materials folder. The .res file needs to be in the top cstrike folder on the web server so the game knows where to get the files. Then transfer the directory structure to your web server. I created a cstrike folder in the web root folder and transferred the directory structure to this folder on the web server so I have this structure on the web server:
      cstrike
      - - maps
      - - materials
      - - - - cs_office_extended
      - - - - - - decals
      - - - - - - plaster
       Then I bzipped the cs_office_extended.bsp file and then I had a cs_office_extended.bsp.bz2 file. The command is simply bzip2 cs_office_extended.bsp.
      
      The last step is to edit your server.cfg file located in cstrike/cfg folder in the game server structure and add this cvar:
      sv_downloadurl “http://www.yourdomain.whatever/cstrike/”
      
      Restart the server to initialize the cvar. Then on your client machine connect to your server and change to this map. You should see the download happen for the bz2 file the nav file and the other asset files under materials.
      
      Also a note about the directory structure on the web server and game server, they have to be identical since that is the way they are downloaded and installed on the client machine. The bsp file is in the maps folder on your game server and the bz2 zipped bsp is in the maps folder on the web server. When the client downloads the bz2 file to the client it unzips it back to a bsp file. You can have all the bz2, nav, and txt files for maps all in the same map folder together but in the asset folders, materials, sound, etc… it is best to have folders with the map names under these with the assets under the map name folder like it is here for cs_office_extended.
      
      
      Hope this wasn’t too confusing. Excuse any grammatical errors and let me know if this was helpful or if you have any problems getting it to work on your server.
      
      

CoveringFire
Admin - CoveringFire's Counter-Strike Source Server
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)