public void SetLuaLoadSucc(string strFile) { try { Logger.d("读取成功:" + strFile); for (int i = 0; i < this.aryRes.Count; i++) { CRes res = this.aryRes[i] as CRes; bool flag = true; for (int j = 0; j < res.aryFileState.Count; j++) { CFileState state = res.aryFileState[j] as CFileState; if (state.strFileName.Equals(strFile)) { state.iLuaState = this.iLuaWaitInit; } else if (state.isLua && (state.iLuaState != this.iLuaWaitInit)) { flag = false; } } if (flag) { res.iLuaState = this.iLuaWaitInit; } } } catch (Exception exception) { Logger.LogNetError(Configer.iCodeCSException, exception.Message + exception.StackTrace.ToString()); } }
public override void DoSelfDuty() { CRes cRes = this.mediator.GetCRes(); CProduct cProduct = ProcessC(cRes); this.mediator.OutputCProduct(cProduct); }
private void InitResouceData(string strConfigInfo) { try { char[] separator = new char[] { '|' }; string[] strArray = strConfigInfo.Split(separator); for (int i = 0; i < strArray.Length; i++) { char[] chArray2 = new char[] { ':' }; string[] strArray2 = strArray[i].Split(chArray2); if (strArray2.Length >= 2) { string str = strArray2[0]; string str2 = strArray2[1]; CRes res = new CRes { strResName = str }; char[] chArray3 = new char[] { ',' }; string[] strArray3 = str2.Split(chArray3); for (int j = 0; j < strArray3.Length; j++) { string key = strArray3[j].ToString(); if (!this.dicFileState.ContainsKey(key)) { this.dicFileState[key] = this.iSTATE_LOCAL; Logger.d("AddToDic:" + key + ",State:" + this.iSTATE_LOCAL.ToString()); } int istate = -1; if (this.dicFileState.ContainsKey(key)) { istate = this.dicFileState[key]; } bool flag = this.isLuaFile(strArray3[j]); res.aryFileState.Add(new CFileState(strArray3[j], istate, flag)); } this.aryRes.Add(res); } } } catch (Exception exception) { Logger.LogNetError(Configer.iCodeCSException, exception.Message + exception.StackTrace.ToString()); } }
public void RefreshDownStatus(string strSuccFile) { try { Logger.d("刷新下载状态:" + strSuccFile); for (int i = 0; i < this.aryRes.Count; i++) { CRes res = this.aryRes[i] as CRes; bool flag = true; for (int j = 0; j < res.aryFileState.Count; j++) { CFileState state = res.aryFileState[j] as CFileState; if (state.strFileName.Equals(strSuccFile)) { state.iDownState = this.iSTATE_LOCAL; } else if (!this.CheckIsDown(state.iDownState)) { flag = false; } if ((this.CheckIsDown(state.iDownState) && this.isLuaFile(state.strFileName)) && !this.dicLoaded.ContainsKey(state.strFileName)) { this.dicLoaded.Add(state.strFileName, true); NotificationCenter.DefaultCenter().PostNotification(null, "OnUILuaLoaded", this.GetLuaName(state.strFileName)); } } if (flag) { res.iLoadState = this.iSTATE_LOCAL; } Logger.d("--Res:" + res.strResName + ",status:" + res.iLoadState.ToString()); } this.Dump(); this.SetLuaLoadSucc(string.Empty); } catch (Exception exception) { Logger.LogNetError(Configer.iCodeCSException, exception.Message + exception.StackTrace.ToString()); } }
public void RefreshLuaLoadStatus() { try { if (this.isNeedLoadLua && this.blIsInitFinish) { for (int i = 0; i < this.aryRes.Count; i++) { CRes res = this.aryRes[i] as CRes; if (((res.iLuaState != this.iLuaInited) && this.CheckIsDown(res.iLoadState)) && ((res.iLuaState != this.iLuaIniting) && this.CheckIsDown(res.iLoadState))) { bool flag = false; bool flag2 = true; for (int k = 0; k < res.aryFileState.Count; k++) { CFileState state = res.aryFileState[k] as CFileState; string strFileName = state.strFileName; if (state.isLua) { flag = true; if (this.isLuaFile(strFileName) && (!this.CheckIsDown(state.iDownState) || (state.iLuaState == -1))) { flag2 = false; } } } if (!flag) { Logger.d("res:" + res.strResName + " no lua"); res.iLuaState = this.iLuaInited; } if (flag2) { res.iLuaState = this.iLuaWaitInit; } if (res.iLuaState == this.iLuaWaitInit) { res.iLuaState = this.iLuaIniting; for (int m = 0; m < res.aryFileState.Count; m++) { CFileState state2 = res.aryFileState[m] as CFileState; string key = state2.strFileName; if (state2.isLua && !this.dicInitLua.ContainsKey(key)) { this.dicInitLua.Add(key, true); Logger.d("开始加载-》" + key); string luaName = this.GetLuaName(key); LuaHelper.GetResManager().LuaInitToVm(luaName); } } res.iLuaState = this.iLuaInited; } } } bool flag3 = true; for (int j = 0; j < this.aryRes.Count; j++) { CRes res2 = this.aryRes[j] as CRes; if (res2.iLuaState != this.iLuaInited) { flag3 = false; break; } } if (flag3) { Logger.d("init lua finish"); this.isNeedLoadLua = false; } } } catch (Exception exception) { Logger.LogNetError(Configer.iCodeCSException, exception.Message + exception.StackTrace.ToString()); } }
private CProduct ProcessC(CRes cRes) { return(new CProduct()); }