using Sog; using Sog.Log; using ProtoCSStruct; namespace World { public class WorldServerStat { private static long m_lastLogTime; public static void Tick(long nowMs) { //每秒记录一次一些信息 if (nowMs < m_lastLogTime + 1000) { return; } m_lastLogTime = nowMs; WriteOnlinePlayerStat(); } private static void WriteOnlinePlayerStat() { ServerStat.Instance.SetValue("allServer", GameReportSvc.WorldOnlinePlayerCount); ServerStat.Instance.SetValue("PlayerInfoWorldObj", WorldServerUtils.GetPlayerTableOp().GetObjCount()); ServerStat.Instance.SetValue("WorldBattleRecordDataCache FreeCount", WorldServerUtils.GetWorldMainlandRecordData().m_cacheStructBattleReplayRecording.GetFreeCount()); ServerStat.Instance.SetValue("WorldHomeCache TotalCount",WorldServerUtils.GetWorldHomeData().m_cacheStructHomeInfo.GetTotalCount()); ServerStat.Instance.SetValue("WorldHomeCache FreeCount", WorldServerUtils.GetWorldHomeData().m_cacheStructHomeInfo.GetFreeCount()); } } }