private bool ReadFinalList(ref NDataReader dr) { this._OutputDebug(string.Format("$$$SysConfig:ReadFinalPatchList! TsCaching.useCustomCacheOnly = {0}", TsCaching.useCustomCacheOnly)); this.m_LoadPatchListVersion = 0; this.m_LoadPatchListVersion = dr["[Header]"]["PatchVersion"]; TsPlatform.FileLog("test 1 m_LoadPatchListVersion = " + this.m_LoadPatchListVersion.ToString()); if (dr.BeginSection("[FinalList]")) { while (!dr.IsEndOfSection()) { NDataReader.Row currentRow = dr.GetCurrentRow(); if (currentRow.LineType == NDataReader.Row.TYPE.LINE_DATA) { PatchFileInfo patchFileInfo = new PatchFileInfo(); patchFileInfo.Version = ((1 >= currentRow.Values.Count) ? 0 : Convert.ToInt32(currentRow.GetColumn(1))); patchFileInfo.FileSize = ((2 >= currentRow.Values.Count) ? 0 : Convert.ToInt32(currentRow.GetColumn(2))); string text = currentRow.GetColumn(0).ToLower(); patchFileInfo.bUseCustomCache = this.CheckCustomCache(text); if (this.FilesList.ContainsKey(text)) { this._OutputDebug(string.Format("이미 등록된 파일명입니다!! {0}", text)); return(false); } this.FilesList.Add(text, patchFileInfo); } dr.NextLine(); } return(true); } return(false); }
private bool _findSection(string sectionName) { int num = 0; for (int i = 0; i < this._owner.m_list_Rows.Count; i++) { NDataReader.Row row = this._owner.m_list_Rows[i]; if (row.LineType == NDataReader.Row.TYPE.LINE_SECTION) { string text = row.GetColumn(0).ToLower(); if (text[0] == '[' && sectionName[0] != '[') { sectionName = string.Format("[{0}]", sectionName); } if (text.Equals(sectionName.ToLower())) { this._beginRow = num; this._beginRowSub = -1; this._currentRow = num + 1; this._currentRowAtSection = 0; return(true); } } num++; } return(false); }
public void SetDataFrom(FinalPatchList owner, NDataReader.Row row) { this.Version = PatchFileInfo.VER_INVAILD; this.FileSize = 0; char platfromChar = '?'; if (row[1].Equals("final")) { this.Version = PatchFileInfo.VER_FINAL; } else { float vER_INVAILD = PatchFileInfo.VER_INVAILD; float.TryParse(row[1], out vER_INVAILD); this.Version = vER_INVAILD; } int fileSize; int.TryParse(row[2], out fileSize); this.FileSize = fileSize; char.TryParse(row[3], out platfromChar); this.PlatfromChar = platfromChar; if (owner.UseFieldNames) { if (owner._idx_CRC != -1) { this.CRC = row[owner._idx_CRC]; } if (owner._idx_PatchLevel != -1) { int patchLevel = 0; int.TryParse(row[owner._idx_PatchLevel], out patchLevel); this.PatchLevel = patchLevel; } if (owner._idx_LangCode != -1) { int langCode = 0; int.TryParse(row[owner._idx_LangCode], out langCode); this.LangCode = langCode; } if (owner._idx_Prepack != -1) { bool bUsePrepack = false; bool.TryParse(row[owner._idx_Prepack], out bUsePrepack); this.bUsePrepack = bUsePrepack; } } }
public PatchFileInfo(NDataReader.Row row) { this.FileSize = 0; char platfromChar = '?'; if (row[1].Equals("final")) { this.nVersion = PatchFileInfo.VER_FINAL; } else { int.TryParse(row[1], out this.nVersion); } int fileSize; int.TryParse(row[2], out fileSize); this.FileSize = fileSize; char.TryParse(row[3], out platfromChar); this.PlatfromChar = platfromChar; }
public bool ReadFrom(NDataReader.Row tsRow) { this.m_kRows.Add(tsRow); return(true); }
private bool ReadFinalList2(ref NDataReader dr) { this._OutputDebug(string.Format("$$$SysConfig:ReadFinalPatchList2! TsCaching.useCustomCacheOnly = {0}", TsCaching.useCustomCacheOnly)); this.m_LoadPatchListVersion = 0; string text = string.Empty; text = dr["[Header]"]["PatchVersion"]; if (text.ToLower().Equals("final")) { this.m_LoadPatchListVersion = PatchFileInfo.VER_FINAL; } else { int.TryParse(text, out this.m_LoadPatchListVersion); } this._OutputDebug("test 3 m_LoadPatchListVersion = " + this.m_LoadPatchListVersion.ToString()); TsPlatform.FileLog("test 3 m_LoadPatchListVersion = " + this.m_LoadPatchListVersion.ToString()); bool result; try { StringBuilder stringBuilder = new StringBuilder(512); StringBuilder stringBuilder2 = new StringBuilder(512); StringBuilder stringBuilder3 = new StringBuilder(512); if (dr.BeginSection("[FinalList2]")) { while (!dr.IsEndOfSection()) { NDataReader.Row currentRow = dr.GetCurrentRow(); if (currentRow.LineType == NDataReader.Row.TYPE.LINE_DATA) { stringBuilder.Length = 0; stringBuilder.Append(currentRow.GetColumn(0)); stringBuilder = PatchFinalList.ReplaceWord(stringBuilder, false); if (stringBuilder[0] == '?') { stringBuilder.Remove(0, 1); stringBuilder3.Length = 0; stringBuilder3.Append(stringBuilder.ToString()); } else { PatchFileInfo patchFileInfo = new PatchFileInfo(currentRow); stringBuilder2.Length = 0; stringBuilder2.AppendFormat("{0}/{1}", stringBuilder3, stringBuilder); stringBuilder2 = stringBuilder2.Replace("//", "/"); string text2 = stringBuilder2.ToString(); patchFileInfo.bUseCustomCache = this.CheckCustomCache(text2); patchFileInfo.szMD5 = currentRow.GetColumn(4); if (!text2.Contains("duplicationfilelist")) { if (this.FilesList.ContainsKey(text2)) { PatchFileInfo patchFileInfo2 = new PatchFileInfo(); this.FilesList.TryGetValue(text2, out patchFileInfo2); this._OutputDebug(string.Format("Warning - duplicated patch list item : {0} / already:{1} new:{2}", text2, patchFileInfo2.nVersion, patchFileInfo.nVersion)); if (patchFileInfo2.nVersion < patchFileInfo.nVersion) { this.FilesList[text2] = patchFileInfo; } } else { this.FilesList.Add(text2, patchFileInfo); } } } } dr.NextLine(); } result = true; } else { result = false; } } catch (Exception ex) { this._OutputDebug(ex.ToString()); result = false; } return(result); }
private void _OnCompleteDownload(IDownloadedItem wItem, object obj) { if (wItem.canAccessString) { try { string safeString = wItem.safeString; NDataReader nDataReader = new NDataReader(); if (!nDataReader.LoadFrom(safeString)) { TsLog.LogWarning(string.Format("NDataReader.LoadFromText failed: {0}", safeString), new object[0]); return; } SortedDictionary <string, PatchFileInfo> sortedDictionary = new SortedDictionary <string, PatchFileInfo>(); StringBuilder stringBuilder = new StringBuilder(512); StringBuilder stringBuilder2 = new StringBuilder(512); StringBuilder stringBuilder3 = new StringBuilder(512); if (nDataReader.BeginSection("[FinalList2]")) { while (!nDataReader.IsEndOfSection()) { NDataReader.Row currentRow = nDataReader.GetCurrentRow(); if (currentRow.LineType == NDataReader.Row.TYPE.LINE_DATA) { stringBuilder.Length = 0; stringBuilder.Append(currentRow.GetColumn(0)); stringBuilder = PatchFinalList.ReplaceWord(stringBuilder, false); if (stringBuilder[0] == '?') { stringBuilder.Remove(0, 1); stringBuilder3.Length = 0; stringBuilder3.Append(stringBuilder.ToString()); } else { PatchFileInfo patchFileInfo = new PatchFileInfo(currentRow); stringBuilder2.Length = 0; stringBuilder2.AppendFormat("{0}/{1}", stringBuilder3, stringBuilder); stringBuilder2 = stringBuilder2.Replace("//", "/"); string text = stringBuilder2.ToString(); if (!text.Contains("duplicationfilelist")) { if (sortedDictionary.ContainsKey(text)) { PatchFileInfo patchFileInfo2 = new PatchFileInfo(); sortedDictionary.TryGetValue(text, out patchFileInfo2); TsLog.Log(string.Format("Warning - duplicated patch list item : {0} / already:{1} new:{2}", text, patchFileInfo2.nVersion, patchFileInfo.nVersion), new object[0]); if (patchFileInfo2.nVersion < patchFileInfo.nVersion) { sortedDictionary[text] = patchFileInfo; } } else { sortedDictionary.Add(text, patchFileInfo); } } } } nDataReader.NextLine(); } } NrTSingleton <AssetBundleURLInfo> .Instance.CollectBundleInfo(sortedDictionary.Keys); } catch (Exception arg) { TsLog.LogWarning(string.Format("The process failed: {0}", arg), new object[0]); } } NrTSingleton <AssetBundleURLInfo> .Instance.IsLoad = true; UnityEngine.Object.Destroy(base.gameObject); }
public abstract bool ParseRowData(NDataReader.Row row);