Пример #1
0
        public uint AddDiffManifestTask(FileManifest mainifest1, FileManifest mainifest2, System.Action <LoadingEventArg> onProgress, System.Action <bool> onComplete)
        {
            if (mainifest1 == null)
            {
                return(0);
            }

            var           loadInfos = mainifest1.CompareFileManifest(mainifest2);
            List <ABInfo> re        = new List <ABInfo>();

            foreach (var abInfo in loadInfos)
            {
                if (abInfo.priority <= FileManifestOptions.AutoHotPriority) //非自动下载级别
                {
                    re.Add(abInfo);
                }
                else if (FileHelper.PersistentFileExists(abInfo.abName))//存在表示已经下载过但是版本不对
                {
                    re.Add(abInfo);
                }
            }

            re.Sort(abInfoCompare);

            return(AddTask(re, FileManifestOptions.ManualPriority, onProgress, onComplete));
        }
Пример #2
0
        public uint AddFirstManifestTask(FileManifest mainifest1, FileManifest mainifest2, System.Action <LoadingEventArg> onProgress, System.Action <bool> onComplete)
        {
            if (mainifest1 == null)
            {
                return(0);
            }

            List <ABInfo> re = new List <ABInfo>();

            var    localABInfos = mainifest1.allAbInfo;
            var    diffABInfos  = mainifest1.CompareFileManifest(mainifest2); //mainifest2.appNumVersion - mainifest1.appNumVersion >= 0;
            ABInfo abInfo;

            for (int i = 0; i < localABInfos.Count; i++)
            {
                abInfo = localABInfos[i];
                if (abInfo.priority >= FileManifestOptions.FirstLoadPriority &&
                    abInfo.priority < FileManifestOptions.AutoHotPriority) //首包下载内容
                {
                    re.Add(abInfo);
                }
            }

            for (int i = 0; i < diffABInfos.Count; i++)
            {
                abInfo = diffABInfos[i];
                re.Add(abInfo);
            }

            re.Sort(abInfoCompare);

            return(AddTask(re, FileManifestOptions.ManualPriority, onProgress, onComplete));
        }