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

[STOCK] Smart Download Manager


Post New Thread Reply   
 
Thread Tools Display Modes
mcpan313
Senior Member
Join Date: Mar 2010
Old 01-31-2013 , 13:28   Re: [STOCK] Smart Download Manager
Reply With Quote #11

Quote:
Originally Posted by berni View Post
You cant get "ztmp", should be:
Code:
new String:fileExtension[5];
__________________
sorry, for my poor english.

Last edited by mcpan313; 01-31-2013 at 13:30.
mcpan313 is offline
Send a message via MSN to mcpan313
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 01-31-2013 , 13:29   Re: [STOCK] Smart Download Manager
Reply With Quote #12

Quote:
Originally Posted by berni View Post
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
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 01-31-2013 , 18:48   Re: [STOCK] Smart Download Manager
Reply With Quote #13

Quote:
Originally Posted by Zephyrus View Post
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 View Post
You cant get "ztmp", should be:
Code:
new String:fileExtension[5];
It's magic code that works without null terminators
ztmp is not a critical thing, I'll fix it.
__________________
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
Despirator
Senior Member
Join Date: Jun 2011
Location: Kazakhstan ->Shymkent
Old 02-25-2013 , 11:33   Re: [STOCK] Smart Download Manager
Reply With Quote #14

i have these errors in the log
Quote:
L 02/25/2013 - 221:51: [SM] Native "GetArrayString" reported: Invalid index -4 (count: 47)
L 02/25/2013 - 221:51: [SM] Displaying call stack trace for plugin "personal_skins.smx":
L 02/25/2013 - 221:51: [SM] [0] Line 144, D:\Games\Servers\CSS-Public_Server\css\cstrike\addons\sourcemod\sc ripting\include\smartdm.inc:ownloader_AddFi leToDownloadsTable()
L 02/25/2013 - 221: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 - 221:51: [SM] [2] Line 56, D:\Games\Servers\CSS-Public_Server\css\cstrike\addons\sourcemod\sc ripting\personal_skins.sp::OnMapStart()
Despirator is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 07-22-2014 , 13:27   Re: [STOCK] Smart Download Manager
Reply With Quote #15

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
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus is offline
DoPe^
Veteran Member
Join Date: Jul 2008
Location: Denmark / Copenhagen
Old 07-25-2014 , 10:11   Re: [STOCK] Smart Download Manager
Reply With Quote #16

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"
__________________
DoPe^ is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 07-25-2014 , 10:30   Re: [STOCK] Smart Download Manager
Reply With Quote #17

ive reuploaded the fixed inc, STRING was defined in my own stocks that i always include so i totally forgot about it
__________________
Taking private C++/PHP/SourcePawn requests, PM me.

Last edited by Zephyrus; 07-25-2014 at 10:35.
Zephyrus is offline
DoPe^
Veteran Member
Join Date: Jul 2008
Location: Denmark / Copenhagen
Old 07-25-2014 , 10:31   Re: [STOCK] Smart Download Manager
Reply With Quote #18

Quote:
Originally Posted by Zephyrus View Post
ive reuploaded the fixed smx, STRING was defined in my own stocks that i always include so i totally forgot about it
Ah alright thanks!
__________________
DoPe^ is offline
NeoxX
AlliedModders Donor
Join Date: Jan 2014
Location: Germany
Old 03-19-2015 , 03:54   Re: [STOCK] Smart Download Manager
Reply With Quote #19

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?
NeoxX is offline
Alienmario
Senior Member
Join Date: Aug 2013
Old 11-19-2015 , 15:45   Re: [STOCK] Smart Download Manager
Reply With Quote #20

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.
Attached Files
File Type: inc smartdm.inc (8.8 KB, 375 views)

Last edited by Alienmario; 11-30-2015 at 17:47.
Alienmario is offline
Reply


Thread Tools
Display Modes

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 06:19.


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