Raised This Month: $ Target: $400
 0% 

HTTP Downloader Plugin


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 08-15-2008 , 01:15   HTTP Downloader Plugin
Reply With Quote #1

This (mostly) replaces my downloader plugin. It uses the sockets module to download a file via HTTP.

This works right now, I wouldn't exactly call it well tested. I'm posting it here rather then in the plugins area as it needs some cleanup before it goes there.

You can get it from http://devicenull.org/files/downloader.0.0.0.1.zip

It only adds one function:
Code:
functag DownloadFile_Sucess public(any:arg);
functag DownloadFile_Error public(type,num,any:arg);

native DownloadFile(const String:destname[],const String:host[],const String:path[],DownloadFile_Sucess:suc,DownloadFile_Error:err,any:arg);
Example:
Code:
#include <sourcemod>
#include <downloader>

public DownloadFile_Sucess:sucess(arg)
{
	PrintToServer("sucess %i",arg);
}

public DownloadFile_Error:error(type,num,arg)
{
	PrintToServer("error %i %i %i",type,num,arg);
}

public OnPluginStart()
{
DownloadFile("devicenull.org.txt","www.devicenull.org","",DownloadFile_Sucess:sucess,DownloadFile_Error:error,1337);
}
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
 



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 14:04.


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