Is there any way for me to add entire folders to a server FastDL, rather than one file at a time? Or is there any application that will add everything for me?
FileZilla my friend.
But you shouldn’t be adding entire folders. Only custom files. Read the GMod wiki for how to setup a sv_downloadurl.
Yes, I have uploaded everything with FileZilla. But I’m a lazy ass and don’t feel like using “resource.AddFile” to add every single file individually.
You shouldn’t force clients to download files they already have. ONLY custom files. The files you have added. All other files that aren’t custom the clients already have.
it won’t download the file if they already have it.
Here’s a bit of code that I use, it works fine.
Put it in \lua\autorun\server\anythinggoeshere.lua
function AddDir(dir) // Recursively adds everything in a directory to be downloaded by client local list = file.FindDir("../"..dir.."/*") for _, fdir in pairs(list) do if fdir != ".svn" then // Don't spam people with useless .svn folders AddDir(dir.."/"..fdir) end end for k,v in pairs(file.Find(dir.."/*", true)) do resource.AddFile(dir.."/"..v) end end AddDir("addons/Real Snowball Swep/materials") AddDir("addons/Real Snowball Swep/models")
isn’t that taken directly from DarkRP
that code doesn’t work anyway
It works for me, and no I think I got it from the wiki
Banana Lord, Read through the GMod wiki and you’ll be sure to find it at the same place as resource.AddFile("") is.
DarkRP uses the exact code, and that code won’t work anymore
Works perfectly for me.
from what I understand it won’t be recursive, file.FindDir can’t use …/