private void Loop() { try { while (CenterClientApi.IsRun()) { long curTime = TimeUtility.GetLocalMilliseconds(); if (m_LastTickTime != 0) { long elapsedTickTime = curTime - m_LastTickTime; if (elapsedTickTime > c_WarningTickTime) { LogSys.Log(LOG_TYPE.MONITOR, "DataCache Network Tick:{0}", curTime - m_LastTickTime); } } m_LastTickTime = curTime; CenterClientApi.Tick(); Thread.Sleep(10); if (m_WaitQuit) { if (PersistentSystem.Instance.StartLastSaveResult == PersistentSystem.SaveState.Failed) { //发起存盘操作失败,重置m_WaitQuit m_WaitQuit = false; } if (PersistentSystem.Instance.LastSaveState == PersistentSystem.SaveState.Success) { LogSys.Log(LOG_TYPE.MONITOR, "DataCache LastSave Success. DataCache quit ..."); Thread.Sleep(10000); CenterClientApi.Quit(); } else if (PersistentSystem.Instance.LastSaveState == PersistentSystem.SaveState.Failed) { LogSys.Log(LOG_TYPE.MONITOR, "DataCache LastSave Failed. DataCache NOT quit ..."); PersistentSystem.Instance.LastSaveState = PersistentSystem.SaveState.Initial; m_WaitQuit = false; } } if (m_LastEchoTime + 5000 < curTime) { m_LastEchoTime = curTime; CenterClientApi.SendCommandByName("DataCache", "Echo"); } } } catch (Exception ex) { LogSys.Log(LOG_TYPE.ERROR, "DataCache.Loop throw exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
private void Loop() { try { while (CenterClientApi.IsRun()) { CenterClientApi.Tick(); Thread.Sleep(10); } } catch (Exception ex) { LogSys.Log(LOG_TYPE.ERROR, "ServerBridge.Loop throw exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
private void Loop() { try { while (CenterClientApi.IsRun()) { CenterClientApi.Tick(); Thread.Sleep(10); if (m_WaitQuit && m_GlobalDataProcessThread.LastSaveFinished && m_DataProcessScheduler.LastSaveFinished) { LogSys.Log(LOG_TYPE.MONITOR, "Lobby quit."); CenterClientApi.Quit(); } } } catch (Exception ex) { LogSys.Log(LOG_TYPE.ERROR, "Lobby.Loop throw exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
private void Loop() { try { while (CenterClientApi.IsRun()) { CenterClientApi.Tick(); Thread.Sleep(10); if (m_WaitQuit && PersistentSystem.Instance.LastSaveFinished) { DataOpSystem.Instance.Enable = false; LogSys.Log(LOG_TYPE.MONITOR, "DataStore quit."); CenterClientApi.Quit(); } } } catch (Exception ex) { LogSys.Log(LOG_TYPE.ERROR, "DataStore.Loop throw exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
private void Loop() { try { while (CenterClientApi.IsRun()) { long curTime = TimeUtility.GetLocalMilliseconds(); if (m_LastTickTime != 0) { long elapsedTickTime = curTime - m_LastTickTime; if (elapsedTickTime > c_WarningTickTime) { LogSys.Log(LOG_TYPE.MONITOR, "Lobby Network Tick:{0}", curTime - m_LastTickTime); } } m_LastTickTime = curTime; CenterClientApi.Tick(); Thread.Sleep(10); if (m_WaitQuit) { //等待10s long startTime = TimeUtility.GetLocalMilliseconds(); while (startTime + 10000 > TimeUtility.GetLocalMilliseconds()) { CenterClientApi.Tick(); Thread.Sleep(10); } //关闭Lobby LogSys.Log(LOG_TYPE.MONITOR, "QuitStep_3. LastSaveDone. Lobby quit..."); CenterClientApi.Quit(); } } } catch (Exception ex) { LogSys.Log(LOG_TYPE.ERROR, "Lobby.Loop throw exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
private void Loop() { try { while (CenterClientApi.IsRun()) { long curTime = TimeUtility.GetLocalMilliseconds(); if (m_LastTickTime != 0) { long elapsedTickTime = curTime - m_LastTickTime; if (elapsedTickTime > c_WarningTickTime) { LogSys.Log(LOG_TYPE.MONITOR, "RoomServer Network Tick:{0}", curTime - m_LastTickTime); } } m_LastTickTime = curTime; CenterClientApi.Tick(); Tick(); Thread.Sleep(10); } } catch (Exception ex) { LogSys.Log(LOG_TYPE.ERROR, "RoomServer.Loop throw exception:{0}\n{1}", ex.Message, ex.StackTrace); } }