Skip to main content

ClientCacheManager.FileDownloader

A private class in Root.Township, Alta.Static. Reach it through att-stubs' publicized assemblies or Harmony's AccessTools.

Client: downloads one file from the joined server's web server (port 1761 unless the server says otherwise) into a local folder, retrying up to three times.

Constructors​

MemberWhat it is
FileDownloader(string name, string serverFolder, IAltaFolder clientFolder)Creates a ClientCacheManager.FileDownloader from name, serverFolder and clientFolder.

Fields​

4 private and internal fields
MemberWhat it is
private Dictionary<uint, byte[]> assemblyDictionary of parts by index. Not used in this build.
private TaskCompletionSource<IAltaFile> completionSourceSource behind Task.
private uint partCountNot used in this build.
private uint totalBytesNot used in this build.

Properties​

MemberWhat it is
IAltaFolder ClientFolder { get; }Local folder the file is saved into (the cache folder when made by ClientCacheManager).
string Name { get; }File name, used both in the URL and as the local file name.
string ServerFolder { get; }Folder path on the server's web server, cache when made by ClientCacheManager.
Task<IAltaFile> Task { get; }Completes with the downloaded file, or null after the last failed attempt.

Events​

MemberWhat it is
event Action<ClientCacheManager.FileDownloader, IAltaFile> FinishedRaised when the download ends, with the file or null if it failed. The manager uses it to drop the downloader.

Methods​

MemberWhat it is
async void Start()Downloads over HTTP, deleting partial files and retrying with a growing delay. Completes Task with the file or null.

Used in​

Members of other types that take, return or hold a FileDownloader: