sv_downloadurl practical?

Ok, so you guys probably know about sv_downloadurl, it redirects players to a http webserver to download the stuff from a server. Problem is, with mods like css it’s easy to create a .res file for a map and put the custom content the clients should download… with Garrysmod there is so many mods and maps it would be ridiculous creating so many .res files and putting so many things in them would be incredibly time consuming. Is there a way to make the clients just download everything in the server’s addons folder? It would then be mirrored by a http webserver where all the files in the addons folder would be .bz2.

Yes, it would.
I’m currently working on an addon for GMod, which makes the gmod-server also run as a http-server. This one will also bz2 the files (just experimental).

Note, that this is a work in progress, and I have just finished the http-server basis. Once I’ve finished it, I’ll release it under Lua/Releases/Binary.

By http server, you mean I could have http://serverIP/MymotdGoesHere.html ? :X.

Using fastdl can be very beneficial, especially combined with bzip2. On the servers I use it on, all content is downloaded roughly within two - five minutes, which includes but is not limited to custom models, sounds, lua, materials (which can be really nasty to download). Combining this with Bzip2 and you have a perfect distribution system. The only downsides are that if you updated the clientside lua, you need to reupload the cache (or at least add the new files) each time. You also need to keep the cache clean otherwise you could have clientds downloading files that are pretty much worthless.

Also, to get all the files for fastdl, I just use a loop to search for the files and / or the file types.

Yes, exactly.

[editline]08:34PM[/editline]

I know what you mean. That’s why I have linked my Apache Webserver directly to my GMod server, just allowing to download from the files I want to allow. I never have to reupload my “fastdl files” again.

This is also my plan of an addon for GMod which turns the GMod server into a webserver which does provide fastdl automatically and with bz2 compression.

Here is an example of my Apache config-file, just if you are interested in. The mentioned paths below are the one of my GMod server:


<VirtualHost *:80>
	## Virtual hostname
	ServerName gmod.daggeringcats.com
  
	## Document root
	DocumentRoot E:/avon/HTTP/gmod
  
  <Directory ~ "E:/avon/HTTP/gmod">
		Options FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>
  
	## Only allow reading from these folders please: maps,materials,models,scripts,sounds,scenes,particles,cache
	<Directory ~ "E:/avon/HTTP/gmod/build/(maps|materials|models|scripts|sound|scenes|particles|cache|resource)">
		Options FollowSymLinks MultiViews
		AllowOverride None
		Order allow,deny
		allow from all
	</Directory>
</VirtualHost>

Wait a second guys, how would I tell them to download something custom? I mean with another game obsidian conflict(applies to any source game), I just spent like 30 minutes writing this out:


"resources"
{
"materials\models\Player\desert_soldier\000.vmt" "file" 
"materials\models\Player\desert_soldier\000.vtf" "file" 
"materials\models\Player\desert_soldier\000_n.vtf" "file" 
"materials\models\Player\desert_soldier\001.vmt" "file" 
"materials\models\Player\desert_soldier\001.vtf" "file" 
"materials\models\Player\desert_soldier\001_n.vtf" "file" 
"materials\models\Player\desert_soldier\002.vmt" "file" 
"materials\models\Player\desert_soldier\002.vtf" "file" 
"materials\models\Player\desert_soldier\002_n.vtf" "file" 
"materials\models\Player\desert_soldier\003.vmt" "file" 
"materials\models\Player\desert_soldier\004.vmt" "file" 
"materials\models\Player\desert_soldier\005.vmt" "file" 
"materials\models\Player\desert_soldier\005.vtf" "file" 
"materials\models\Player\desert_soldier\005_n.vtf" "file" 
"materials\models\Player\desert_soldier\006.vmt" "file" 
"materials\models\Player\desert_soldier\006.vtf" "file" 
"materials\models\Player\desert_soldier\006_n.vtf" "file" 
"materials\models\Player\desert_soldier\ct_gign.vmt" "file" 
"materials\models\Player\desert_soldier\ct_gign.vtf" "file" 
"materials\models\Player\desert_soldier\ct_gign_normal.vtf" "file" 
"materials\models\Player\desert_soldier\ct_sas_glass.vmt" "file" 
"materials\models\Player\desert_soldier\ct_sas_glass.vtf" "file" 
"materials\models\Player\desert_soldier\ct_urban.vmt" "file" 
"materials\models\Player\desert_soldier\ct_urban.vtf" "file" 
"materials\models\Player\desert_soldier\ct_urban_normal.vtf" "file" 
"materials\models\Player\desert_soldier\goggles.vtf" "file" 
"materials\models\Player\desert_soldier\goggles_normal.vtf" "file" 
"materials\models\Player\desert_soldier	_arctic.vmt" "file" 
"materials\models\Player\desert_soldier\T-ATTACHMENTS_utx-us-soldier_goggles.vmt" "file" 
"materials\models\Player	_arctic	_arctic.vmt" "file" 
"materials\models\Player	_arctic	_arctic.vtf" "file" 
"materials\models\Player	_arctic	_arctic_normal.vtf" "file" 
"models\Player\desert_soldier.dx80.vtx" "file" 
"models\Player\desert_soldier.dx90.vtx" "file" 
"models\Player\desert_soldier.mdl" "file" 
"models\Player\desert_soldier.phy" "file" 
"models\Player\desert_soldier.sw.vtx" "file" 
"models\Player\desert_soldier.txt" "file" 
"models\Player\desert_soldier.vvd" "file" 
"models\Player\desert_soldier.xbox.vtx" "file" 
"materials\models	hespectator\od\od.vmt" "file" 
"materials\models	hespectator\od\od.vtf" "file" 
"materials\models	hespectator\od\od_normal.vtf" "file" 
"materials\VGUI\playermodels\Player\odst_soldier.vmt" "file" 
"materials\VGUI\playermodels\Player\odst_soldier.vtf" "file" 
"models\Player\odst_soldier.dx80.vtx" "file" 
"models\Player\odst_soldier.dx90.vtx" "file" 
"models\Player\odst_soldier.mdl" "file" 
"models\Player\odst_soldier.phy" "file" 
"models\Player\odst_soldier.sw.vtx" "file" 
"models\Player\odst_soldier.txt" "file" 
"models\Player\odst_soldier.vvd" "file" 
"models\Player\odst_soldier.xbox.vtx" "file" 
"models\Player\Metrocop.dx80.vtx" "file" 
"models\Player\Metrocop.dx90.vtx" "file" 
"models\Player\metrocop.mdl" "file" 
"models\Player\Metrocop.phy" "file" 
"models\Player\Metrocop.sw.vtx" "file" 
"models\Player\Metrocop.txt" "file" 
"models\Player\Metrocop.vvd" "file" 
"models\Player\Metrocop.xbox.vtx" "file"
"materials\models\Player\stalkerexo\act_st_exoskel_tank_ex_dolg.vmt" "file" 
"materials\models\Player\stalkerexo\act_st_exoskel_tank_ex_dolg.vtf" "file" 
"materials\models\Player\stalkerexo\act_st_exoskel_tank_specnaz.vmt" "file" 
"materials\models\Player\stalkerexo\act_st_exoskel_tank_specnaz.vtf" "file" 
"materials\models\Player\stalkerexo\act_st_exoskel_tank_svoboda.vmt" "file" 
"materials\models\Player\stalkerexo\act_st_exoskel_tank_svoboda.vtf" "file" 
"materials\models\Player\stalkerexo\act_st_exoskelet_loner_tank.vmt" "file" 
"materials\models\Player\stalkerexo\act_st_exoskelet_loner_tank.vtf" "file" 
"models\Player\exo_specna.dx80.vtx" "file" 
"models\Player\exo_specna.dx90.vtx" "file" 
"models\Player\exo_specna.mdl" "file" 
"models\Player\exo_specna.phy" "file" 
"models\Player\exo_specna.sw.vtx" "file" 
"models\Player\exo_specna.txt" "file" 
"models\Player\exo_specna.vvd" "file" 
"models\Player\exos_loner.dx80.vtx" "file" 
"models\Player\exos_loner.dx90.vtx" "file" 
"models\Player\exos_loner.mdl" "file" 
"models\Player\exos_loner.phy" "file" 
"models\Player\exos_loner.sw.vtx" "file" 
"models\Player\exos_loner.txt" "file" 
"models\Player\exos_loner.vvd" "file" 
"models\Player\exosk_dolg.dx80.vtx" "file" 
"models\Player\exosk_dolg.dx90.vtx" "file" 
"models\Player\exosk_dolg.mdl" "file" 
"models\Player\exosk_dolg.phy" "file" 
"models\Player\exosk_dolg.sw.vtx" "file" 
"models\Player\exosk_dolg.txt" "file" 
"models\Player\exosk_dolg.vvd" "file"
"materials\Konata\8e5eedd8.vmt" "file"
"materials\Konata\8e5eedd8.vtf" "file"
"materials\Konata\994ecdee.vmt" "file"
"materials\Konata\994ecdee.vtf" "file"
"materials\Konata\b93e90b3.vmt" "file"
"materials\Konata\b93e90b3.vtf" "file"
"materials\shana\8e5eedd8.vmt" "file"
"materials\shana\8e5eedd8.vtf" "file"
"materials\shana\994ecdee.vmt" "file"
"materials\shana\994ecdee.vtf" "file"
"materials\shana\994ecdee_hr.vtf" "file"
"materials\shana\994ecdee_hr2.vtf" "file"
"materials\shana\994ecdee_hr3.vtf" "file"
"materials\shana\b93e90b3.vmt" "file"
"materials\shana\b93e90b3.vtf" "file"
"models\player\ex_freedom.dx80.vtx" "file"
"models\player\ex_freedom.dx90.vtx" "file"
"models\player\ex_freedom.mdl" "file"
"models\player\ex_freedom.phy" "file"
"models\player\ex_freedom.sw.vtx" "file"
"models\player\ex_freedom.txt" "file"
"models\player\ex_freedom.vvd" "file"
"models\player\konata.dx80.vtx" "file"
"models\player\konata.dx90.vtx" "file"
"models\player\konata.mdl" "file"
"models\player\konata.phy" "file"
"models\player\konata.sw.vtx" "file"
"models\player\konata.txt" "file"
"models\player\konata.vvd" "file"
"models\player\shana.dx80.vtx" "file"
"models\player\shana.dx90.vtx" "file"
"models\player\shana.mdl" "file"
"models\player\shana.phy" "file"
"models\player\shana.sw.vtx" "file"
"models\player\shana.txt" "file"
"models\player\shana.vvd" "file"
"sound\music\bagger288.mp3" "file"
"sound\music\BT.mp3" "file"
"sound\music\PYT.mp3" "file"
"sound\music\Auto_Drop_Cash_5.wav" "file"
"sound\music\Auto_Dying_7.wav" "file"
"sound\music\Follow_me_4.wav" "file"
"sound\music\GrabbedByClot1.wav" "file"
"sound\music\Help_2.wav" "file"
"sound\music\Insult_players_1.wav" "file"
"sound\music\Insult_players_2.wav" "file"
"sound\music\Kev_Victory7.wav" "file"
"sound\music\KF_Abandon.mp3" "file"
"sound\music\KF_Containment.mp3" "file"
"sound\music\No_1.wav" "file"
"sound\music\No_3.wav" "file"
"sound\music\Sorry_4.wav" "file"
"sound\music\Yes_4.wav" "file"
"sound\music\Yes_9.wav" "file"
"sound\beachtown\gangsta.mp3" "file"
"sound\music\Auto_Healing_3.wav" "file" 
"maps\RP_HomeTown1999.res" "file" 
}

Now, how would I do this with Garrysmod? I am thinking doing the exact same thing, but instead of just uploading those files, I’ll upload my whole Garrysmod folder(all files bz2 of course)

Also thanks for helping out guys.

Are you seriously saying that your addon would make a sort of a free sv_downloadurl, but from the server itself?

MasterChi, resource.AddFile(“sound/something.mp3”) in Lua is about the simplest way.

Thanks, I’ll take a look at this.

Yes. The srcds-server will listen to a port using sockets and answer as a http-server and provide the files.
I currently need to fix up some issues like loading files threaded and mounting addons etc.
Should be done this or next weekend for a public test. (I can only work on this on weekends).

Sounds awesome. Like it should get into gmod as a default. :L.

What port? Hopefully the one the server uses? :l. (Server host. Really don’t see them opening other ports than what already is…) .

lrn2installlighthttpdkthnx.


(User was banned for this post ("Trolling" - Dragon))

Lrn2notspamkthxbai.

Sadly, you can’t take the same port twice. I’m thinking of using the servers-port + 8080. So 27015 + 8080 = 35095.
For the server-hoster issue: I’ll add an option to change the port. Server hosters generally open several ports, not only for a gameserver. You can then switch to these ports.

Would it be simple to make it load the port number from a text file? (With understanding that it can’t be the same as the server.) .

Of course.

Estimated release time?

One, two months[weeks]? :l.

Yet unknown.
I’ve been working on something different lately. I’ll continue to code on the module for fastdownload today but I can’t promise when it’s finished.
I once said earlier before I might finish it next weekend or so.

Hey
You might want take a look on this, it is a small project of mine.
I use it on 5Gmod Servers, and it works great.

That requires you to have a site. :confused: . Or server. (Not as in gmod, as in file server…) .

Hell, I found a guy who’s hosting it for free. :3 . (And has been for awhile now. Hardly anyone’s noticed that he’s willing :confused: .) .

Can’t wait for that module though…