private void ThreadProc(object state) { do { Thread.Sleep(1000); }while (!this.dbMgr.Initialized); for (;;) { try { long nowMs = TimeUtil.NOW(); DateTime now = TimeUtil.NowDateTime(); Global.UpdateNowTime(now); if (nowMs >= this.LastSaveServerStateMs + 30000L) { this.LastSaveServerStateMs = nowMs; this.dbMgr.SaveCopyTeamAnalysisData(this.teamMgr.BuildAnalysisData()); } this.teamMgr.Update(); AsyncDataItem[] evList = this.teamMgr.PopAsyncEvent(); ClientAgentManager.Instance().BroadCastAsyncEvent(this.GameType, evList); this.dbMgr.CheckLogAsyncEvents(evList); SpecPriorityActivityMgr.Instance().Update(now); int sleepMS = (int)(TimeUtil.NowDateTime() - now).TotalMilliseconds; this.dbMgr.SaveCostTime(sleepMS); sleepMS = 1600 - sleepMS; if (sleepMS < 50) { sleepMS = 50; } Thread.Sleep(sleepMS); } catch (Exception ex) { LogManager.WriteExceptionUseCache(ex.ToString()); } } }
public SpecPrioritySyncData SpecPriority_GetActivityConditionInfo() { return(SpecPriorityActivityMgr.Instance().SpecPriority_GetActivityConditionInfo()); }
public int SpecPriority_ModifyActivityConditionNum(int key, int add) { return(SpecPriorityActivityMgr.Instance().SpecPriority_ModifyActivityConditionNum(key, add)); }