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

[EXTENSION] Web downloader


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 04-29-2007 , 22:25   [EXTENSION] Web downloader
Reply With Quote #1

Current revision: 7

Download
Source

This extension allows you to download files from a HTTP server. It is non-blocking, and doesn't cause any noticeable FPS loss.

Check out the include file for function information.. example plugin in the following post.
Changes in rev7:
Changed support for handles so they are used correctly.
Removed DestroyDownloader, use CloseHandle instead

Changes in rev6:
Added ClearOutput() which lets you reset the output method.
Fixed a bug when you could not start a new download in the callback.
File output paths are assumed to be from the mod directory now, not the root srcds directory
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/

Last edited by devicenull; 05-06-2007 at 00:13.
devicenull is offline
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 04-29-2007 , 22:25   Re: [EXTENSION] Web downloader
Reply With Quote #2

Code:
#pragma semicolon 1 #include <downloader> #include <sourcemod> public Plugin:myinfo = {     name = "DownloadTest",     author = "devicenull",     description = "Downloader test plugin",     version = "0.1.0.0",     url = "http://www.devicenull.org/" }; new Handle:down; public DownloadComplete(const sucess, const status, Handle:arg) {     PrintToServer("DownloadComplete: %i %i",sucess, status);     CloseHandle(down); } public Progress(const recvSize, const totalSize, Handle:arg) {     PrintToServer("Download Progress: %i/%i ",recvSize,totalSize)} public OnPluginStart() {     down = CreateDownloader();     SetURL(down,"http://www.devicenull.org/");         SetCallback(down,DownloadComplete);     SetProgressCallback(down,Progress);         SetOutputFile(down,"devicenull.html");         Download(down); }
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/

Last edited by devicenull; 05-06-2007 at 00:13.
devicenull is offline
API
Veteran Member
Join Date: May 2006
Old 04-29-2007 , 22:31   Re: [EXTENSION] Web downloader
Reply With Quote #3

Woah, great job
API is offline
Send a message via AIM to API
BAILOPAN
Join Date: Jan 2004
Old 04-30-2007 , 09:10   Re: [EXTENSION] Web downloader
Reply With Quote #4

Nice
__________________
egg
BAILOPAN is offline
jopmako
Senior Member
Join Date: Jul 2006
Location: QQ:331537639
Old 05-05-2007 , 23:45   Re: [EXTENSION] Web downloader
Reply With Quote #5

that's really cool, thx.
__________________
QQ31537639
jopmako is offline
Send a message via MSN to jopmako
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 05-06-2007 , 00:13   Re: [EXTENSION] Web downloader
Reply With Quote #6

Updated to rev7, I now use handles correctly.
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
Olly
Senior Member
Join Date: Mar 2007
Location: UK
Old 07-05-2007 , 09:35   Re: [EXTENSION] Web downloader
Reply With Quote #7

Cant get it to work :\

Used the example plugin, and all i get is "DownloadComplete: 1 200"

No progress callback
__________________
Tumblr Me: http://raspberryteen.tumblr.com


// Yarrrr!
Olly is offline
Send a message via MSN to Olly
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 07-05-2007 , 10:28   Re: [EXTENSION] Web downloader
Reply With Quote #8

Neat. I missed this. I read my admins from a vBB forum usergroup, and have a php file that builds my admins_simple.ini.

I could use this to update it, instead of my cron that re-FTP's the file every so often. Though, nothing wrong with my cron either :p
__________________
I'm a blast from the past!
ferret is offline
BurstDragon
Junior Member
Join Date: Jun 2006
Location: Northern Germany
Old 09-07-2007 , 12:17   Re: [EXTENSION] Web downloader
Reply With Quote #9

Silly question: How to install it?

I can't get it to work....



greez Burst
BurstDragon is offline
Podunk
Senior Member
Join Date: Nov 2005
Location: Florida
Old 09-07-2007 , 13:37   Re: [EXTENSION] Web downloader
Reply With Quote #10

wow this is a pimp project!

This opens up worlds of ideas for me
__________________
Check out my website at http://matthewmiller.info
Podunk is offline
Send a message via MSN to Podunk
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 20:45.


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