void Download(string patchFile, ITransferStatus status, IAbsoluteFilePath filePath)
 {
     using (
         var scoreMirrorSelector = _createMirrorSelectorWithLimit(10,
                                                                  GetMirrors().Select(x => new Uri(x + "/" + CdnPath)).ToArray()))
         using (var multiMirrorFileDownloader = _createMultiMirrorFileDownloader(scoreMirrorSelector.Value)) {
             multiMirrorFileDownloader.Value.Download(new MultiMirrorFileDownloadSpec(patchFile, filePath)
             {
                 Progress = status
             });
         }
 }
 async Task DownloadFileAsync(string remoteFile, IAbsoluteFilePath destinationPath,
                              IMirrorSelector scoreMirrorSelector, CancellationToken token,
                              Func <IAbsoluteFilePath, bool> confirmValidity, ITransferStatus status)
 {
     destinationPath.MakeSureParentPathExists();
     using (var dl = _createMultiMirrorFileDownloader(scoreMirrorSelector)) {
         await
         dl.Value.DownloadAsync(new MultiMirrorFileDownloadSpec(remoteFile,
                                                                destinationPath, confirmValidity) {
             CancellationToken = token,
             Progress          = status
         },
                                token).ConfigureAwait(false);
     }
 }
        void DownloadAndInstallCommunityPatchInternal(string patchFile, IAbsoluteDirectoryPath destinationPath,
                                                      ITransferStatus status, IAbsoluteDirectoryPath gamePath)
        {
            var filePath = destinationPath.GetChildFileWithName(patchFile);

            Download(patchFile, status, filePath);
            status.Reset();
            var gameFilePath = gamePath.GetChildFileWithName(filePath.FileName);

            Tools.Compression.Unpack(filePath, gamePath, true, true, true);
            try {
                InstallPatch(gameFilePath, "-silent -incurrentfolder");
            } finally {
                gameFilePath.FileInfo.Delete();
            }
        }
 void InstallOfficialPatchInternal(string patchFile, IAbsoluteDirectoryPath tempPath, ITransferStatus status) {
     var filePath = tempPath.GetChildFileWithName(patchFile);
     Download(patchFile, status, filePath);
     status.Reset();
     InstallPatch(filePath, "-silent");
 }
 void Download(string patchFile, ITransferStatus status, IAbsoluteFilePath filePath) {
     using (
         var scoreMirrorSelector = _createMirrorSelectorWithLimit(10,
             GetMirrors().Select(x => new Uri(x + "/" + CdnPath)).ToArray()))
     using (var multiMirrorFileDownloader = _createMultiMirrorFileDownloader(scoreMirrorSelector.Value)) {
         multiMirrorFileDownloader.Value.Download(new MultiMirrorFileDownloadSpec(patchFile, filePath) {
             Progress = status
         });
     }
 }
 void DownloadAndInstallCommunityPatchInternal(string patchFile, IAbsoluteDirectoryPath destinationPath,
     ITransferStatus status, IAbsoluteDirectoryPath gamePath) {
     var filePath = destinationPath.GetChildFileWithName(patchFile);
     Download(patchFile, status, filePath);
     status.Reset();
     var gameFilePath = gamePath.GetChildFileWithName(filePath.FileName);
     Tools.Compression.Unpack(filePath, gamePath, true, true, true);
     try {
         InstallPatch(gameFilePath, "-silent -incurrentfolder");
     } finally {
         gameFilePath.FileInfo.Delete();
     }
 }
 public Task DownloadFileAsync(string remoteFile, IAbsoluteFilePath destinationPath,
                               IMirrorSelector selector, ITransferStatus status, CancellationToken token)
 => DownloadFileAsync(remoteFile, destinationPath, selector, token, x => true, status);
 public Task DownloadFileAsync(string remoteFile, IAbsoluteFilePath destinationPath,
         IMirrorSelector selector, ITransferStatus status, CancellationToken token)
     => DownloadFileAsync(remoteFile, destinationPath, selector, token, x => true, status);
 async Task DownloadFileAsync(string remoteFile, IAbsoluteFilePath destinationPath,
     IMirrorSelector scoreMirrorSelector, CancellationToken token,
     Func<IAbsoluteFilePath, bool> confirmValidity, ITransferStatus status) {
     destinationPath.MakeSureParentPathExists();
     using (var dl = _createMultiMirrorFileDownloader(scoreMirrorSelector)) {
         await
             dl.Value.DownloadAsync(new MultiMirrorFileDownloadSpec(remoteFile,
                     destinationPath, confirmValidity) {
                     CancellationToken = token,
                     Progress = status
                 },
                 token).ConfigureAwait(false);
     }
 }
示例#10
0
        void InstallOfficialPatchInternal(string patchFile, IAbsoluteDirectoryPath tempPath, ITransferStatus status)
        {
            var filePath = tempPath.GetChildFileWithName(patchFile);

            Download(patchFile, status, filePath);
            status.Reset();
            InstallPatch(filePath, "-silent");
        }
示例#11
0
 public StatusWrapper2(ITransferStatus wrapped, Action <double, long?> act) : base(wrapped, act)
 {
     _wrapped = wrapped;
 }