private void TickUploadCount() { if (Time.timeSinceStartup - tmpLastUploadTime >= GlobalID.UPLOAD_ONLINE_COUNT_TIME * 1000) { gs2ws.OnlineCount msg = PacketPools.Get(gs2ws.msg.ONLINE_COUNT) as gs2ws.OnlineCount; msg.count = (ushort)this.GetClientSessionCount(); ServerNetManager.Instance.Send2WS(msg); tmpLastUploadTime = Time.timeSinceStartup; } }
/// <summary> /// 上报玩家数量 /// </summary> private void OnPlayerCount(PacketBase packet) { gs2ws.OnlineCount msg = packet as gs2ws.OnlineCount; ServerInfoManager.Instance.UpdatePlayerCount(msg.server_uid.gs_uid, msg.count); }