/** * Callback for DC_UpdateFile * * @param bSuccess True if no error occured and the file is ready to be read. * @param hSocketData Is a trie containing the data used when calling DC_UpdateFile * Available fields are: 'host', 'port', 'url', 'path' (of the * local file) and furl (concatenated url). * @param data any:data that has been passed when calling DC_UpdateFile */functag DCCallback public(bool:bSuccess, Handle:hSocketData, any:data);/** * Downloads a file if it's older than iMaxAge. * * @param sFilePath Path to local file. It will be overwritten. * @param sHost Host to receive data from * @param iPort Port to connect to on the host * @param sWebPath Remote path * @param iMaxAge Maximum age of the local file in seconds * @param cbSuccess Callback to call on success/fail * @param data any:data to be passed to the callback * @param sProtocol Use this to specify any other protocol than 'http', e.g. 'https'. * This forces usage of curl! * * @return True if the file is younger than iMaxAge and the callback has * already been called. */native bool:DC_UpdateFile(const String:sFilePath[], const String:sHost[], iPort, const String:sWebPath[], iMaxAge, DCCallback:cbSuccess, any:data = 0, const String:sProtocol[] = "http");
Attached Files Get Plugin or Get Source (tDownloadCache.sp - 9.9 KB) tDownloadCache.inc (1.5 KB) tDownloadCache.smx (7.7 KB)Wyświetl pełny artykuł