private int parseMapFiles() { UpdateLog.DEBUG_LOG("解析map文件+++"); int num = 1; RepairList.Clear(); this.BackDownloadList.Clear(); _backDownloadDict.Clear(); this._parsedMapDataList.Clear(); string resourceUrl = ""; for (int i = 0; i < this._currentData.VersionModelBaseList.Count; i++) { VersionModel model = this._currentData.VersionModelBaseList[i]; string str2 = model.Map_url.Replace(@"\", "/"); string str3 = str2.Substring(str2.LastIndexOf("/") + 1); string mapFile = Path.Combine(BaseFlow._storeDir, str3); resourceUrl = model.ResourceUrl; MapFileManage manage = new MapFileManage(); num = manage.parseMapFile(mapFile, model.ResourceUrl, BaseFlow._storeDir); if (num <= -1) { return(num); } this._parsedMapDataList.AddRange(manage.GetMapFileDataList()); } UpdateLog.DEBUG_LOG("解析map文件---"); return(num); }
//解析本地所有的map文件 private int parseMapFiles() { UpdateLog.DEBUG_LOG("解析map文件+++"); int ret = CodeDefine.RET_SUCCESS; MapFileDataListForDownload.Clear(); _parsedMapDataList.Clear(); string resUrl = ""; for (int i = 0; i < _currentData.VersionModelBaseList.Count; i++) { VersionModel mapModel = _currentData.VersionModelBaseList[i]; //分段版本比本地分段更大,则跳过解析,本地可能没有 if (LocalXml.BaseResVersion.CompareTo(mapModel.ToVersion.Replace("。", ".")) < 0) { continue; } string mapUrl = mapModel.Map_url.Replace("\\", "/"); string mapName = mapUrl.Substring(mapUrl.LastIndexOf("/") + 1); UnityEngine.Debug.Log("mapName:" + mapName); string localMapFile = System.IO.Path.Combine(_storeDir, mapName); resUrl = mapModel.ResourceUrl; MapFileManage mapManager = new MapFileManage(); ret = mapManager.parseMapFile(localMapFile, mapModel.ResourceUrl, _storeDir); if (ret <= CodeDefine.RET_FAIL) { return(ret); } _parsedMapDataList.AddRange(mapManager.GetMapFileDataList()); } UpdateLog.DEBUG_LOG("解析map文件---"); return(ret); }