Пример #1
0
        private void ConverUpdateItem(KeyValuePair <string, AssetUpdateDifferenceList.Item> pair, Dictionary <string, AssetUpdateConfigList.Item> dict)
        {
            var filePath     = pair.Value.filePath;
            var fileMd5      = pair.Value.fileMd5;
            int packageindex = 0;

            AssetUpdateConfigList.Item     itemCfg = null;
            AssetUpdateDifferenceList.Item itemSrc = pair.Value;
            if (dict != null && dict.TryGetValue(filePath, out itemCfg))
            {
                packageindex = itemCfg.packageId;
            }

            var    item      = new Item(itemSrc, itemCfg);
            string urlPath   = GetFileDownloadUrl(item);
            string savePaths = GetSaveFilePath(item);
            var    package   = GetOrCreatePackage(packageindex);

            package.size += pair.Value.fileSize;

            package.GetUrlList().Add(urlPath);
            package.GetSaveList().Add(savePaths);


            GetOrCreatePathItemDict().Add(savePaths.ToLower(), item);
            GetOrCreateMd5ItemDict().Add(fileMd5.ToLower(), item);
        }
Пример #2
0
 public Item(AssetUpdateDifferenceList.Item itemSrc, AssetUpdateConfigList.Item itemCfg)
 {
     this.itemSrc = itemSrc;
     this.itemCfg = itemCfg;
 }