Malwarebytes for Home | Anti-Malware Premium | Free Trial Download

Reply to Thread

Post a reply to the thread: How to setup a FastDL mirror for a Garry's Mod 13 Game Server

Your Message

Click here to log in

 
 

You may choose an icon for your message from this list

Additional Options

  • Will turn www.example.com into [URL]http://www.example.com[/URL].

Topic Review (Newest First)

  • 24th July 2017, 02:47 AM
    RoboCop

    How to setup a FastDL mirror for a Garry's Mod 13 Game Server

    In this tutorial, I will cover how to properly setup a working FastDL mirror for your game server.It is important that you read everything here, as FastDL's are very fragile
    Requirements


    • Garry's Mod Server
    • Web Hosting or Web Server with FTP Access


    As I stated earlier, FastDL's are very, VERY fragile. One step wrong and you will notice that it won't work.Note: You can still use Workshop Content on your server while having a FastDL, with +host_workshop_collection_id and all.

    Tools you require:-


    • GMAD Extractor GUI - This tool allows us to extract the .gma file, returning a legacy addon
    • bzip2 - This is what you will use to compress the files. I have modified the batch script to support recursive compression.
    • Fox-Warrior's Resource Generator - This tool generates
      resource.AddFile() lines for our files.


    To the tutorial! The player will only look for certain file-types in certain folders on the FastDL mirror, which are:

    • maps
      • .bsp

    • materials
      • .vmt
      • .vtf

    • models
      • .dx80.vtx
      • .dx90.vtx
      • .mdl
      • .phy
      • .sw.vtx
      • .vvd

    • sound
      • .mp3
      • .wav

    • particles
      • .pcf

    • resource
      • .ttf - (Font)


    Note that this is how your FastDL folder structure should look like. No addons folder, no lua folder, no other folder at all! This is where most people makes a mistake, by having their files in an addons folder like they do on their server. Read this block below and you'll understand why:

    The addons folder is emulated

    As the title says, the addons folder is emulated on your server. Everything inside of it is "mounted" on your server, as if their files were in the root of your server. And as so, your server doesn't tell your players this when they join. If you would have a file inside addons/someaddon/models/model.mdl, the server would tell the player to download models/model.mdl, and that's why you have to upload the model directly to the models directory and NOT into addons/someaddon/models on your FastDL. You can keep the model inside the addons directory on the server though.

    1. Download & Extract

    Download the addon you want from Workshop, both to your server and to your computer. If the addon is purely lua, close this tutorial as lua is distributed directly to the client through the server.After you've done that, open up GMAD Extractor GUI that you downloaded earlier and click on Open. If you can't see your addon in the list there, click Browse and head to your Garry's Mod addons folder and select the addon from there. Click the addon you want, and then press the Select button. After that click the Extract all button and choose where you want your content to be extracted to, let's say your desktop.Now you should have a legacy addon folder on your desktop, go ahead and open it up. You should see a set of folders that I listed further up in this tutorial and an addons.txt file.

    2. Generate lua - Skip this part if your addon is a map

    Next up is using Fox-Warrior's Resource Generator. Open it up, click on File>Select a directory and go to your desktop and select the legacy addon folder. You should see now that it generates a list of files. If it doesn't, you've done something wrong. After that, click on File>Generate lua file>File>AddFile and a box will come up with where you want to save your lua file, so just save it on the desktop.

    The file should have lines like this:

    if (SERVER) then
    resource.AddFile("materials/models/material.vmt")
    resource.AddFile("models/player/model.mdl")
    resource.AddFile("sound/sound.mp3")
    end
    Upload this file to your lua/autorun directory on your server.

    3. Compress

    Now we want to compress the files using bzip.Hold down [CTRL] and select any of the folders that you see in the list above; maps, materials, models, sound, particles or resource. This will select all those folders. Hit [CTRL+X] and open up the compress folder inside the bzip folder. In there, hit [CTRL+V] and it will paste the folders in there. Now go up on directory and launch the bzip.bat, not the bzip2.exe as it does nothing without the arguments supplied by the batch file. You will see a CMD window popup telling you that it compresses the files. Once it's done, press any key on your keyboard and the window will disappear.

    4. Upload

    Connect to your FastDL via FTP or whatever you use.Upload the folders in the compress folder to your FastDL. Your FastDL should have the folders in the list I've been speaking so much about. So it should ONLY contain these directories:

    • maps
    • materials
    • models
    • sound
    • particles
    • resource


    5. Editing server.cfg

    Next up is editing your server.cfg file.Add these lines to it (change the domain to whatever yours is and the trailing fastdl to whichever folder you uploaded everything to):
    Code:
    sv_downloadurl "http://domain.com/fastdl"
    sv_allowdownload 0 // This disables ServerDL
    sv_allowupload 0 // This is a security measure6.
    Reload your cfg or restart your server

    Reload your cfg with
    exec server.cfg in server console or restart your server. Done!This is how my FastDL ended up looking like:
    And in my case, this is how my server.cfg looks like:
    Code:
    sv_downloadurl "http://domain.com/fastdl/ttt1"
    
    


    Here is a bit of information you really should read!

    Why is FastDL superior to WorkshopDL or ServerDL?

    ServerDL is REALLY slow. It has a speed limit that is very low, doesn't support file compression and uses the servers networking CPU core. It also has a file size limit which is 64MB! This applies to LAN servers aswell. Do I even have to explain further why you shouldn't go with this?
    WorkshopDL is the method to use unless you don't have the option to use FastDL.

    FastDL is superior to WorkshopDL in many ways.

    • Upsides
    • Easy to use - Compared to FastDL, it is a little easier to use. However if you choose WorkshopDL over FastDL for simplicity, you are not elighible to host a server in my eyes.
    • One file - As the files are packed into one file, it doesn't have to reset the connection for each file to download, meaning once you get up to a certain download rate, it will stay at that rate. However, this doesn't have huge impact, but it's a feature.


    • Downsides
      • Compression - The compression is not as good as bzip's compression rate.
      • Unneeded content - If you were to add two models from an addon pack of five models, the player would have to download all five models.
      • Steam Workshop is slow - If you haven't noticed already, Steam Workshop is very slow. It is constantly sending files to alot of players. I'm sure Steam has set a speed limit on the Workshop aswell, although I can't confim it. After all, what do you expect when you provide access to such heavy files on a network so fragile as Steam's?
      • Downtime & Disruptions - Steam is very fragile, it often goes down and they have routine maintenance every week!



    FastDL is by far the ultimate, most superior way of distributing your server content.

    • Upsides
      • Compression - FastDL supports .bz2 compression. For example, the rp_evocity_v2d map is 155MB large when decompressed, but 75MB when compressed! That's a total of 49.93% less that your players have to download and amount of disk space your hosting package requires. This alone should be enough for you use FastDL.
      • No speed limits - FastDL has no speed limits at all. The only throttling that would occur is either by the players or hosts network speed being maxed out.
      • You are in full control - You decide exactly what files will be downloaded. If you only want to use two models from a model pack of five, you can tell the server that the players should only download those two models.
      • Cached Files - You can setup your web-server in any way you want, meaning that you can force your web-server to pre-cache the files, making the distribution of them instantaneous!

    • Downsides
      • Tricky & Fragile - FastDL can be a bit tricky, but once you get the hang of it you will never run into problems. It's also fragile, one step wrong can render your FastDL useless.
      • Can cost money - If you don't have any web hosting and don't have your own VPS/Dedicated Server to install a web-server on, you would have to pay montly for a web-hosting package. These are fairly cheap, around $5/month.


    http://web.archive.org/web/201409261...arrys-mod.html


Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •  
DMCA.com Protection Status

https://apg-clan.org tested by Norton Internet Security https://apg-clan.org tested by McAfee Internet Security

Flag Counter