View Single Post
Backup
Senior Member
Join Date: Jul 2010
Location: Česká Republika
Old 05-22-2018 , 13:44   Re: [EXTENSION] Late Downloads
Reply With Quote #37

@Dragokas:
It would be much easier if you would tell me what is your use case, what are you trying to achivie with this extension. I have a strong feeling we're reinventing a wheel here.

If you are calling AddLateDownload at map start, you don't need this extension at all, you can directly add the files into download table.

There is no easy way of checking whether client has the file downloaded. But if I recall correctly, if you call the AddLateDownload function on already existing file, it should immediately call the callback signaling succes. I'm not sure, I'd have to check.

Quote:
Originally Posted by Dragokas View Post
Is there any restriction for the number of consecutive calls of AddLateDownload()?
Mean, if I don't want to call array alternative - AddLateDownloads().
AddLateDownloads is pretty much just a wrapper around AddLateDownload. So call it as much as you want.

Quote:
Originally Posted by Dragokas View Post
Is it normal OnDownloadSuccess returns duplicate records:
- one for client ID == 0
- second for the actual client ID.
?
Yes, as stated in the documentation:
Code:
/**
 * Called when client successfully downloaded a file. This forward might be called before AddLateDownload(s) returns!
 *
 * @param iClient		Client index. Index 0 signals removal of the file from the download queue - all clients downloaded or failed to download the file.  
 * @param filename		Name of the successfully downloaded file. 
 */
Quote:
Originally Posted by Dragokas View Post
Do you return client ID real-time (not time-delayed)? Mean, is it reliable that you use ClientID instead of UserID?
Yes. You won't get fresher ClientID than this. I have the most real-timey ClientIDs in town.
__________________
Sorry for my english.
Backup is offline