game.MountGMA upgrade
I would like the function to have a second argument that would allow filtering the types of files that do not need to be mount from addon.
For example, I need to get all the models and textures, but I don't need any possible malicious code from the addon to be run and I don't have time to check each such addon from workshop for the lua file, so it would be worth preventing them before mount.
I imagine the best way would probably be through some sort of sequential array of strings/patterns to match (with wildcard support of course). It would also have to not filter anything by default when the argument isn't provided, so it doesn't break existing addons.
So when it's used without the filter argument, everything loads and it acts as normal:
steamworks.DownloadUGC( 104548572, function( name )
game.MountGMA( name )
end )
Then when the filter argument is provided, it only loads what matches (or doesn't match?) the filter:
steamworks.DownloadUGC( 104548572, function( name )
game.MountGMA( name, {
"materials/*", -- All materials
"models/*", -- All models
"sound/*.mp3", -- only mp3 sound files
} )
end )
Dunno if the filter should be a whitelist or blacklist tho. I'd personally prefer a whitelist, to make sure nothing slips through as this seems to be what you're after.
A callback function with a boolean return that passes every file would be better.
Would be very useful
Was just about to make a gmod request for it, this would be super useful Currently i have to manually parse the GMA and create a new one from scratch, store it in DATA. I do this to remove lua files and junk that isn't needed for my player model hotloader.
It would also be great if GMAs could be loaded from memory