Force download help

Post Reply
incognito
New to forums
New to forums
Posts: 3
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Wed Jun 26, 2013 10:43 pm

Force download help

Post by incognito »

For some reason my FastDL doesn't work. I contacted support. They told me to make the client force download the content.

So, I made a file called downloads.lua and placed it in lua/autorun/server. It didn't work. Here is the file:

Code: Select all

local path = "../"..GM.Folder.."/models"
local folders = {""}
while true do
   local curdir = table.remove(folders,1)
   if not curdir then break end
   local searchdir = path..curdir
   for _, filename in ipairs(file.Find(searchdir.."/*")) do
      if filename ~= ".svn" then
         if file.IsDir(searchdir.."/"..filename) then
            table.insert(folders,curdir.."/"..filename)
         else
            resource.AddSingleFile(string.sub(curdir.."/"..filename,2))
         end
      end
   end
end
I was assured by support that this code was right yet was pointed here for support... which is what I thought they were meant to do. Anyway, the files are in use so I see no reason for them not to download. And I don't see why the FastDL is not working. Disabling FastDL doesn't help either. Could someone please aid me?
Simmi
New to forums
New to forums
Posts: 8
Joined: Fri Jun 21, 2013 8:26 pm

Re: Force download help

Post by Simmi »

Try changing the name of the file to example.lua For some reason on my TTT server I can only get force dl to work if the file is named that. May not work but doesn't hurt to try.
incognito
New to forums
New to forums
Posts: 3
Joined: Wed Jun 26, 2013 10:43 pm

Re: Force download help

Post by incognito »

That didn't work
Simmi
New to forums
New to forums
Posts: 8
Joined: Fri Jun 21, 2013 8:26 pm

Re: Force download help

Post by Simmi »

What are you trying to add?
incognito
New to forums
New to forums
Posts: 3
Joined: Wed Jun 26, 2013 10:43 pm

Re: Force download help

Post by incognito »

About 10 models and materials that go with it.

Right now I'm just adding every single file. Takes a while but at least it works.
Simmi
New to forums
New to forums
Posts: 8
Joined: Fri Jun 21, 2013 8:26 pm

Re: Force download help

Post by Simmi »

Mine is in lua/autorun/example.lua And to add the ones I have on my server i go thru each model and material file adding it buy using.

resource.AddFile("the file path") but you have to do it for each file. I havent found another way yet.
User avatar
Sir Nipah
This is my homepage
This is my homepage
Posts: 76
Joined: Mon Jul 08, 2013 3:38 am
Location: Australia/Melbourne
Contact:

Re: Force download help

Post by Sir Nipah »

Hi incognito have you set sv_allowdownload "0" in server.cfg?
Simmi wrote:I havent found another way yet.
Here you go Resource generator
Image Garry's Mod veteran.
User avatar
Sir Nipah
This is my homepage
This is my homepage
Posts: 76
Joined: Mon Jul 08, 2013 3:38 am
Location: Australia/Melbourne
Contact:

Re: Force download help

Post by Sir Nipah »

Can't edit so I'l just make a new post.

Code: Select all

local path = "../"..GM.Folder.."/models"
local folders = {""}
while true do
   local curdir = table.remove(folders,1)
   if not curdir then break end
   local searchdir = path..curdir
   for _, filename in ipairs(file.Find(searchdir.."/*")) do
      if filename ~= ".svn" then
         if file.IsDir(searchdir.."/"..filename) then
            table.insert(folders,curdir.."/"..filename)
         else
            resource.AddFile(string.sub(curdir.."/"..filename,2))
         end
      end
   end
end
Fixed
Image Garry's Mod veteran.
User avatar
hiimcody1
Staff
Staff
Posts: 1595
Joined: Wed Dec 28, 2011 4:59 pm

Re: Force download help

Post by hiimcody1 »

Sir Nipah wrote:Can't edit so I'l just make a new post.

Code: Select all

local path = "../"..GM.Folder.."/models"
local folders = {""}
while true do
   local curdir = table.remove(folders,1)
   if not curdir then break end
   local searchdir = path..curdir
   for _, filename in ipairs(file.Find(searchdir.."/*")) do
      if filename ~= ".svn" then
         if file.IsDir(searchdir.."/"..filename) then
            table.insert(folders,curdir.."/"..filename)
         else
            resource.AddFile(string.sub(curdir.."/"..filename,2))
         end
      end
   end
end
Fixed
We actually refer to this specific function in our KB already: http://www.nfoservers.com/forums/viewto ... 219#p36219
User avatar
Sir Nipah
This is my homepage
This is my homepage
Posts: 76
Joined: Mon Jul 08, 2013 3:38 am
Location: Australia/Melbourne
Contact:

Re: Force download help

Post by Sir Nipah »

hiimcody1 wrote:We actually refer to this specific function in our KB already: http://www.nfoservers.com/forums/viewto ... 219#p36219
My apologies I was unaware.
Image Garry's Mod veteran.
User avatar
hiimcody1
Staff
Staff
Posts: 1595
Joined: Wed Dec 28, 2011 4:59 pm

Re: Force download help

Post by hiimcody1 »

Oh it's no issue, just pointing it out in a shameless attempt to promote the KB :3
Post Reply