AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Snippets and Tutorials (https://forums.alliedmods.net/forumdisplay.php?f=112)
-   -   [STOCK] Smart Download Manager (https://forums.alliedmods.net/showthread.php?t=206496)

mcpan313 01-31-2013 13:28

Re: [STOCK] Smart Download Manager
 
Quote:

Originally Posted by berni (Post 1884128)

You cant get "ztmp", should be:
Code:

new String:fileExtension[5];

Zephyrus 01-31-2013 13:29

Re: [STOCK] Smart Download Manager
 
Quote:

Originally Posted by berni (Post 1884128)
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

well if its a folder of models that wont really do what hes probably looking for

berni 01-31-2013 18:48

Re: [STOCK] Smart Download Manager
 
Quote:

Originally Posted by Zephyrus (Post 1884168)
well if its a folder of models that wont really do what hes probably looking for

He didn't mention models, that's why I wrote it.

Quote:

Originally Posted by mcpan313 (Post 1884167)
You cant get "ztmp", should be:
Code:

new String:fileExtension[5];

It's magic code that works without null terminators :P
ztmp is not a critical thing, I'll fix it.

Despirator 02-25-2013 11:33

Re: [STOCK] Smart Download Manager
 
i have these errors in the log
Quote:

L 02/25/2013 - 22:31:51: [SM] Native "GetArrayString" reported: Invalid index -4 (count: 47)
L 02/25/2013 - 22:31:51: [SM] Displaying call stack trace for plugin "personal_skins.smx":
L 02/25/2013 - 22:31:51: [SM] [0] Line 144, D:\Games\Servers\CSS-Public_Server\css\cstrike\addons\sourcemod\sc ripting\include\smartdm.inc::Downloader_AddFi leToDownloadsTable()
L 02/25/2013 - 22:31:51: [SM] [1] Line 101, D:\Games\Servers\CSS-Public_Server\css\cstrike\addons\sourcemod\sc ripting\personal_skins.sp::Command_Reload()
L 02/25/2013 - 22:31:51: [SM] [2] Line 56, D:\Games\Servers\CSS-Public_Server\css\cstrike\addons\sourcemod\sc ripting\personal_skins.sp::OnMapStart()

Zephyrus 07-22-2014 13:27

Re: [STOCK] Smart Download Manager
 
i just updated this include finally, got quite a few fixes and new features too, there are 2 stocks that might be useful outside of this include too:

FileExists2 - checks if a file exists either on disk or somewhere inside the custom folder
OpenFile2 - capable of opening files inside the custom folder, for example if the path of the file is: "custom/my_plugin/test.txt" then you can just open that like this: OpenFile2("test.txt", "r");
If the file doesn't exist it will just work as the original OpenFile function

DoPe^ 07-25-2014 10:11

Re: [STOCK] Smart Download Manager
 
I am getting this when I try to compile a plugin with smartdm included :)

Code:

/sourcemod/scripting/include\smartdm.inc(39) : error 017: undefined symbol "STRING"
/sourcemod/scripting/include\smartdm.inc(48) : error 017: undefined symbol "STRING"
/sourcemod/scripting/include\smartdm.inc(61) : error 017: undefined symbol "STRING"
/sourcemod/scripting/include\smartdm.inc(62) : error 017: undefined symbol "STRING"
/sourcemod/scripting/include\smartdm.inc(182) : error 017: undefined symbol "STRING"
/sourcemod/scripting/include\smartdm.inc(182) : error 035: argument type mismatch (argument 4)
/sourcemod/scripting/include\smartdm.inc(239) : error 017: undefined symbol "STRING"
/sourcemod/scripting/include\smartdm.inc(265) : error 017: undefined symbol "STRING"
/sourcemod/scripting/include\smartdm.inc(267) : error 017: undefined symbol "STRING"
/sourcemod/scripting/include\smartdm.inc(279) : error 017: undefined symbol "STRING"


Zephyrus 07-25-2014 10:30

Re: [STOCK] Smart Download Manager
 
ive reuploaded the fixed inc, STRING was defined in my own stocks that i always include so i totally forgot about it

DoPe^ 07-25-2014 10:31

Re: [STOCK] Smart Download Manager
 
Quote:

Originally Posted by Zephyrus (Post 2173555)
ive reuploaded the fixed smx, STRING was defined in my own stocks that i always include so i totally forgot about it

Ah alright :D thanks!

NeoxX 03-19-2015 03:54

Re: [STOCK] Smart Download Manager
 
Quote:

[SM] Native "GetArrayString" reported: Invalid index -42 (count: 645)
[SM] Displaying call stack trace for plugin "store/store-skins.smx":
[SM] [0] Line 159, C:\Users\Panda\Dropbox\Projects\Store\include \smartdm.inc:: Downloader_AddFileToDownloadsTable()
[SM] [1] Line 178, store-skins.sp::LoadItem()
Can anyone help me to fix it?

Alienmario 11-19-2015 15:45

Re: [STOCK] Smart Download Manager
 
1 Attachment(s)
I've discovered a bug with model's materials that are inside custom folder not downloading. Turns out FileExists2 compares cached files by names but doesn't correctly format the filenames/paths to match.

So I did a quick fix by replacing "\" with "/" and turning filenames lowercase before comparing.

Great Stock Btw, very useful:)!

Edit: added fix for some uppercase paths that still weren't downloading
Edit2: everything is now converted lowercase before adding to the downloads table (due to linux issues). It might not be very efficient but I'm done with this for now. Someone could probably rewrite this to use new syntax and streamline it a bit more but it appears to be working finally.


All times are GMT -4. The time now is 22:39.

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