void ComparerVersion() { if (!couldComparerVersion) { return; } couldComparerVersion = false; Logger.LogWarp.Log("ComparerVersion"); Logger.LogWarp.Log(Path.Combine(localDownLoadRoot, versionFileName)); string localVersion = GetGameVersion2(Path.Combine(localDownLoadRoot, versionFileName)); string serverVersion = GetGameVersion2(Path.Combine(localDownLoadRoot, versionFileNameTmp)); Logger.LogWarp.Log("localVersion=" + localVersion + " serverVersion=" + serverVersion); int retCode = ComparerVersion(serverVersion, localVersion); //服务器版本大 if (retCode >= 0) { var http = new HttpDownLoad(); Dictionary <string, string> urls = new Dictionary <string, string>(); urls.Add(this.serverDownloadUrl + this.assetbundleFileName, assetbundleFileNameTmp); urls.Add(this.serverDownloadUrl + this.bundleHashFileName, bundleHashFileNameTmp); urls.Add(this.serverDownloadUrl + this.manifestFileName, manifestFileNameTmp); http.DownLoads(urls, localDownLoadRoot, true, DownLoadDetailCallback); } else { updateFinished = true; } }
void ComparerDetail() { if (!coundComparerDetail) { return; } coundComparerDetail = false; Logger.LogWarp.Log("ComparerDetail"); string localBundlePath = Path.Combine(localDownLoadRoot, this.bundleHashFileName); string serverBundlePath = Path.Combine(localDownLoadRoot, this.bundleHashFileNameTmp); string bundleName = Path.GetFileNameWithoutExtension(UFrameConst.Bundle_Hash_Txt_Name); string localBundleHash = GetTxtFromBundle(localBundlePath, bundleName); string serverBundleHash = GetTxtFromBundle(serverBundlePath, bundleName); var localHashSet = AddTxtToHashSet(localBundleHash); var serverHashSet = AddTxtToHashSet(serverBundleHash); //localHashSet.ExceptWith(serverHashSet); //serverHashSet.Add("111112222"); //serverHashSet.ExceptWith(localHashSet); Logger.LogWarp.Log("serverHashSet " + serverHashSet.Count); Dictionary <string, string> urls = new Dictionary <string, string>(); foreach (var v in serverHashSet) { string[] strs = v.Split(new char[] { '=' }, System.StringSplitOptions.RemoveEmptyEntries); urls.Add(this.serverDownloadUrl + strs[0], strs[0]); } var http = new HttpDownLoad(); http.DownLoads(urls, localDownLoadRoot, true, DownloadBundleCallback); }