You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

38 lines
1.2 KiB

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());
}
}
}