GameInstaller¶
IGameInstaller
checks for the existence and integrity of the file and downloads it if necessary.
The GameInstaller fires events that indicate the progress of the installation. See Event Handling
Example¶
var installer = ParallelGameInstaller.CreateAsCoreCount(new HttpClient());
var file = new GameFile("name")
{
Path = "absolute path of the file",
Hash = "SHA1 checksum, in hex string",
Size = 1024, // file size
Url = "URL to download the file",
};
await installer.Install([file], fileProgress, byteProgress, CancellationToken.None);
BasicGameInstaller¶
Single-threaded installer
ParallelGameInstaller¶
Multi-threaded installer. CreateAsCoreCount
method initializes a new ParallelGameInstaller
with the number of cores of the current PC.
You can specify the maximum number of concurrences for each task: