void manifest_Complete(object sender, Net.AssetDownloader.Asset.CompleteEventArgs e)
        {
            var asset = (Net.AssetDownloader.Asset)sender;
            var c     = e.GetCache();

            using (c)
            {
                if (c != null && c.HasData)
                {
                    if (asset.type == Net.AssetDownloader.Asset.AssetType.File)
                    {
                        try
                        {
                            c.SetPositionToContent();
                            AddFilesFromManifest(c, baseIds);

                            Create404Manifest(asset.fileId);
                        }
                        catch (Exception ex)
                        {
                            Util.Logging.Log(ex);
                        }
                    }

                    bool isComplete;
                    lock (this)
                    {
                        progress.manifestsDownloaded++;
                        progress.contentBytesCore += e.ContentLength;
                        isComplete = progress.manifestsDownloaded == progress.manifestsTotal;
                    }

                    if (isComplete)
                    {
                        OnManifestsComplete();
                    }
                }
                else
                {
                    lock (this)
                    {
                        if (progress.errored)
                        {
                            return;
                        }
                        progress.errored = true;
                    }

                    if (Error != null)
                    {
                        Error(this, "Failed to retieve manifests", null);
                    }
                }
            }
        }
Beispiel #2
0
 void manifestUnused_Complete(object sender, Net.AssetDownloader.Asset.CompleteEventArgs e)
 {
     manifest_Complete(sender, e, false);
 }
Beispiel #3
0
 void file_Complete(object sender, Net.AssetDownloader.Asset.CompleteEventArgs e)
 {
     lock (this)
         progress.filesDownloaded++;
 }