public static void NotifyTotalOnlineNumToServer(DBManager dbMgr) { long nowTicks = DateTime.Now.Ticks / 10000L; if (nowTicks - OnlineUserNumMgr.LastNotifyDBTicks >= 30000L) { OnlineUserNumMgr.LastNotifyDBTicks = nowTicks; int totalNum = LineManager.GetTotalOnlineNum(); } }
public static void WriteTotalOnlineNumToDB(DBManager dbMgr) { DateTime dateTime = DateTime.Now; long nowTicks = dateTime.Ticks / 10000L; if (nowTicks - OnlineUserNumMgr.LastWriteDBTicks >= 120000L) { OnlineUserNumMgr.LastWriteDBTicks = nowTicks; int totalNum = LineManager.GetTotalOnlineNum(); string strMapOnlineInfo = LineManager.GetMapOnlineNum(); DBWriter.AddNewOnlineNumItem(dbMgr, totalNum, dateTime, strMapOnlineInfo); } }
/// <summary> /// 将当前的在线人数写入通知统计服务器 /// </summary> /// <param name="dbMgr"></param> public static void NotifyTotalOnlineNumToServer(DBManager dbMgr) { DateTime dateTime = DateTime.Now; long nowTicks = dateTime.Ticks / 10000; if (nowTicks - LastNotifyDBTicks < (30L * 1000L)) { return; } LastNotifyDBTicks = nowTicks; //获取所有线路总的在线人数 int totalNum = LineManager.GetTotalOnlineNum(); //GameDBManager.DBEventsWriter.CacheRecentonline(-1, // GameDBManager.ZoneID, // totalNum, // dateTime.ToString("yyyy-MM-dd HH:mm:ss")); }
/// <summary> /// 将当前的在线人数写入数据库中 /// </summary> /// <param name="dbMgr"></param> public static void WriteTotalOnlineNumToDB(DBManager dbMgr) { DateTime dateTime = DateTime.Now; long nowTicks = dateTime.Ticks / 10000; if (nowTicks - LastWriteDBTicks < (2L * 60L * 1000L)) { return; } LastWriteDBTicks = nowTicks; //获取所有线路总的在线人数 int totalNum = LineManager.GetTotalOnlineNum(); String strMapOnlineInfo = LineManager.GetMapOnlineNum(); //添加一个新的在线人数记录 DBWriter.AddNewOnlineNumItem(dbMgr, totalNum, dateTime, strMapOnlineInfo); //GameDBManager.DBEventsWriter.CacheOnlineuer(-1, // GameDBManager.ZoneID, // totalNum, // dateTime.ToString("yyyy-MM-dd HH:mm:ss")); }