Does resource.AddFile check if file existis in .gma

I’m currently thinking of developing a tool to easily manage a Fast Download server. I’ve seen too many questions on here already about how to set up FastDL so I want to provide an easy to set up way (with proper error checking) of managing your FastDL, browser based.

I want to add a feature where my tool will generate a fastdl_download.lua (and automatically uploading it to the autorun folder), but I don’t want it to take up extra download time. I like to have legacy addons on my server rather than .gma files. I still use resource.AddWorkshop to push the content to my clients, but if I use a FastDL tool such as Fox-Warrior’s Resources Generator, it’ll create resource.AddFile for my legacy addons. Will this make my clients download the files again, or is Garry’s Mod clever enough to detect the content is already available on the client’s PC?

Unfortunately gma will always be downloaded, even if you’re subscribed. You can have up to 3 copies of the same gma in your gmod install dir if I recall correctly…

Instead of generating a resource file you need to replace each time, why not just dynamically generate the resource.AddSingleFile( x ) and resource.AddWorkshop( x ) calls? I do this on my server, and my resource system will be released in the near future. It works very well; it can handle addons subscribed ( by the server collection ), additional addons that should be downloaded to the client which the server has, but extracted to remove Lua files ( such as M9k, etc ), and it reads contents of the addon files so it doesn’t download map files when they aren’t necessary.

Use resource.AddFile if it is fastdl / server-dl content. resource.AddWorkshop is very fast, much faster than fastdl and serverdl so that method is recommended.

I think you are missing my point.

I am trying to create a free tool for people to manage their FastDL. This is for the majority of people that does not know how to bzip their files or set their file paths correctly.

What my goal is, is to code a platform made in Bootstrap and PHP (as almost every webhost allows PHP). The user only has to upload it to his / her FastDL. As soon as they log in, they can add a server, enter it’s FTP details and Garry’s Mod root path. If this is incorrect, an error will be given (something SourceRSC doesn’t, it just bzips GMod binaries in this case). It’ll generate a list of all the files that have to be synced, leaving out some information just like your plugin. Everything is customizable, so there will be a list to ignore certain files, to not bzip .pngs (.png.bz2 didn’t work in the past, is this fixed?), more features I still have to think through.

Some people use resource.AddWorkshop. If people download .gma files, and a .gma file has a model called model1.mdl, will the player also download model1.mdl from the FastDL, or not? That is my main concern. I do not want to make the download time for people’s server up to twice as long. If this doesn’t work, I will drop the method to automatically generate a fastdownload.lua file and upload it to the server.

I have plenty of people who told me different, plus, Workshop downloads are capped on a certain speed I believe. If I have 1 gbit webserver I can utilize the full 180 mbit download speed I have, with Workshop I won’t, at least, never have achieved that speed.

Both files would be downloaded if I recall correctly.

Workshop is faster than FastDL because FastDL works on the principle that for each file it creates a new connection, then downloads then closes the connection. This can take seconds for a 1 byte file. The speed may be the same when downloading, but the constant dropping and reconnecting while downloading will cause it to be much slower.

On top of that, workshop addons are incredibly well compressed; 64mb in the workshop can be a huge file-size extracted.

Do a test; set up fastdl, clear your addons and try downloading. Record the time it takes from player_connect game-event until PlayerInitialSpawn ( actually, you won’t be in game by then, use this: )

Do the same thing with 1, 2, 3 or however many workshop files it takes to make up the data. You’ll see workshop is much faster.

On top of downloading going faster because repeated connections are made less frequently, when addons are extracted the loading time exponentially increases.

I had an issue running Lua files in M9k and other addons because it put me over the limit. I tried to extract all addons and delete the Lua files. Loading time was minutes when normally connecting to my dev is less than 30 seconds, if that. Not only that, but auto-refresh with the addons extracted literally locked gmod up for 45seconds or so. Typically with 3mb of code, no repeats, ~70,000 lines of code excluding whitespace, new lines and comments, it takes 5 seconds. With my custom auto-refresh it takes about .5-1 second.

Try that as a test too, load 3 gmas vs 3 extracted gmas and get the time. Compare it with the loose files.

I’m not trying to discourage you from creating the tool; I’m sure it will benefit many people, but please do some testing before deciding whether or not to proceed, it may not be worth it or you may even improve upon your own idea / solution.