AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   [EXTENSION] Web downloader (https://forums.alliedmods.net/showthread.php?t=54611)

devicenull 04-29-2007 22:25

[EXTENSION] Web downloader
 
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

devicenull 04-29-2007 22:25

Re: [EXTENSION] Web downloader
 
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); }

API 04-29-2007 22:31

Re: [EXTENSION] Web downloader
 
Woah, great job :)

BAILOPAN 04-30-2007 09:10

Re: [EXTENSION] Web downloader
 
Nice :D

jopmako 05-05-2007 23:45

Re: [EXTENSION] Web downloader
 
that's really cool, thx.

devicenull 05-06-2007 00:13

Re: [EXTENSION] Web downloader
 
Updated to rev7, I now use handles correctly.

Olly 07-05-2007 09:35

Re: [EXTENSION] Web downloader
 
Cant get it to work :\

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

No progress callback

ferret 07-05-2007 10:28

Re: [EXTENSION] Web downloader
 
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

BurstDragon 09-07-2007 12:17

Re: [EXTENSION] Web downloader
 
Silly question: How to install it?

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



greez Burst

Podunk 09-07-2007 13:37

Re: [EXTENSION] Web downloader
 
wow this is a pimp project!

This opens up worlds of ideas for me :up:


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

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