Raised This Month: $32 Target: $400
 8% 

[STOCK] Smart Download Manager


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 01-23-2013 , 07:29   [STOCK] Smart Download Manager
Reply With Quote #1

This is a small snippet that can automatically detect all the files related to an .mdl/.vmt and add them to the downloads table automatically. It also works with other file types, it will just skip the extra code for those. To use it simply include the inc file and change AddFileToDownloadsTable function calls to Downloader_AddFileToDownloadsTable. It also has caching so it should only parse the files once and on next function call it will just use the cache. Let me know if it doesn't work with some .mdl/.vmt so I can fix it.

Changelog:
1.0 - Initial release
1.1 - Fixed bug with models that have mulitple VMT files
1.2 - Fixed bug that 1.1 caused, lmao
1.5 - Quite a lot of fixes, support for files inside the "custom" directory
1.6 - Added missing define
Attached Files
File Type: inc smartdm.inc (8.0 KB, 1654 views)
__________________
Taking private C++/PHP/SourcePawn requests, PM me.

Last edited by Zephyrus; 07-25-2014 at 10:29.
Zephyrus is offline
Peace-Maker
SourceMod Plugin Approver
Join Date: Aug 2008
Location: Germany
Old 01-23-2013 , 13:18   Re: [STOCK] Smart Download Manager
Reply With Quote #2

That's an awesome idea! Perfectly dynamic.
__________________
Peace-Maker is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 01-23-2013 , 13:34   Re: [STOCK] Smart Download Manager
Reply With Quote #3

I'm sure this checks if a file doesn't exist and doesn't add to the download table right?
Very useful indeed for plugins that require certain files.
Mitchell is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 01-23-2013 , 13:46   Re: [STOCK] Smart Download Manager
Reply With Quote #4

Quote:
Originally Posted by Mitchell View Post
I'm sure this checks if a file doesn't exist and doesn't add to the download table right?
Very useful indeed for plugins that require certain files.
once its cached it assumes the files havent got removed but at first it does a check yes
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus is offline
necavi
Veteran Member
Join Date: Sep 2010
Old 01-23-2013 , 16:56   Re: [STOCK] Smart Download Manager
Reply With Quote #5

Very nice, sounds almost exactly like what I had been planning to make!
necavi is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 01-30-2013 , 09:59   Re: [STOCK] Smart Download Manager
Reply With Quote #6

fix the code in Downloader_GetMaterialsFromMDL, .vtf to .vmt. MDL file handles only vmt materials
Despirator is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 01-30-2013 , 13:33   Re: [STOCK] Smart Download Manager
Reply With Quote #7

Quote:
Originally Posted by Despirator View Post
fix the code in Downloader_GetMaterialsFromMDL, .vtf to .vmt. MDL file handles only vmt materials
1.2 - Fixed bug that 1.1 caused, lmao

i fixed it alraedy :p
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus is offline
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 01-30-2013 , 14:42   Re: [STOCK] Smart Download Manager
Reply With Quote #8

oh, sorry fro bothering you here. Didn't notice at 26
Despirator is offline
shavit
AlliedModders Donor
Join Date: Dec 2011
Location: Israel
Old 01-30-2013 , 15:17   Re: [STOCK] Smart Download Manager
Reply With Quote #9

Please add a stock to download a whole directory and its sub directories.
Amazing.
__________________
retired
shavit is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 01-31-2013 , 12:40   Re: [STOCK] Smart Download Manager
Reply With Quote #10

Quote:
Originally Posted by shavit View Post
Please add a stock to download a whole directory and its sub directories.
Amazing.
That already exists in smlib:

PHP Code:
stock File_AddToDownloadsTable(const String:path[], bool:recursive=true, const String:ignoreExts[][]=_smlib_empty_twodimstring_arraysize=0); 
Code
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode