Gmod force download resources.lua generator

Post Reply
User avatar
Vanderburg
Former staff
Former staff
Posts: 1253
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sat Nov 13, 2010 7:27 am
Location: Dallas, TX

Gmod force download resources.lua generator

Post by Vanderburg »

I'm working on a couple different things for a website designed to generate various configuration files for various games. I've just added some support for Gmod in the form of a script that will create a resources.lua file used to force downloads of fastDL and workshop addons.

It's probably not too difficult to break and there's no real instruction as to how to use it on the site itself, yet, but you to add a collection, you would enter only the 9 digit collection ID. For the site, you would put the full path to your fastDL, where it is hosted on webhosting (It would basically be exactly what you have for the sv_downloadurl variable in your server.cfg file). This means including /server/ at the end, if this is where your files are.

You can play with it here: http://www.configcreator.com/

If you break it in some unusual way, feel free to let me know. There is no consequence to breaking it that I'm aware of, except you might just have to re-enter the ID or URL. As long as you use it properly, it should work and if it breaks, it only breaks for you, so, I'm not too worried about it.

Feedback is appreciated!
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Gmod force download resources.lua generator

Post by soja »

The only flaw I see is when multiple servers use 1 directory, for example on our fastdl site for gmod it ended up generating 40k lines with tons of php file_get_contents errors(and took forever :P).

http://gflclan.com/soja/Screenshot_08-1 ... -05-09.png

It seems like it eventually makes some sort of double url?


http://soja.hosted.nfoservers.com/fastd ... val/beats/

only half of that should be there, after the double // is a repeat of before.

http://soja.hosted.nfoservers.com/fastd ... tzombiev2/
Not a NFO employee
User avatar
Vanderburg
Former staff
Former staff
Posts: 1253
Joined: Sat Nov 13, 2010 7:27 am
Location: Dallas, TX

Re: Gmod force download resources.lua generator

Post by Vanderburg »

That's unfortunate. It was doing that before, where it was repeating a folder that made it mess up the path it was looking into, and since the function is recursive, it can get a bit ugly. There's not much I can do about two servers using the same exact folder for their files, because there's simply no way to tell something to tell them apart, but I'll have to do some digging on the folder problem, since I thought I had that taken care of.
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Gmod force download resources.lua generator

Post by soja »

would it be possible to log into the gmod server itself to get custom files? Users would need to enter their FTP info of course, and you would somehow need to exclude stock files(maybe not after steampipe?).
Not a NFO employee
User avatar
Vanderburg
Former staff
Former staff
Posts: 1253
Joined: Sat Nov 13, 2010 7:27 am
Location: Dallas, TX

Re: Gmod force download resources.lua generator

Post by Vanderburg »

That would be...complicated and I prefer not to require credentials from a user. I could potentially add at some point, a customizable list of folders to ignore (The files would need to be on fastDL to work anyway).

The bug you mentioned previous has been fixed, too. It was something stupid on my end.

It only lists 28854 files for your site when it's working properly. :)
User avatar
Vanderburg
Former staff
Former staff
Posts: 1253
Joined: Sat Nov 13, 2010 7:27 am
Location: Dallas, TX

Re: Gmod force download resources.lua generator

Post by Vanderburg »

I've done a major overhaul on this. It will now search through your fastDL a bit more intelligently. It'll limit its search to your materials, models, resource and sound folders, but if you think it should look in other folders, let me know.

Also, I've figured out why it was putting everything on a single line for people that copied it into Notepad, and fixed that.

It'll now give you a bit of a progress of what it finds, as it finds it, so you don't have to sit there waiting for 20 minutes wondering if it's working.

Annnd! You can download the config you create now. That was pretty fun to implement...

Anyway, feel free to play around with it, try to break it through normal usage, etc. Let me know what you think.

http://www.configcreator.com/create/gmod/resources.lua
Post Reply