Beispiel #1
0
        /// <summary>
        /// 打印发送消息
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="tbuff"></param>
        public void ShowSendMsgLog <T>(MsgNoC2S msgNo, T tbuff)
        {
            if (msgNo == MsgNoC2S.HALL_BEAT_C2S || msgNo == MsgNoC2S.BATTLE_BEAT_C2S)
            {
                return;
            }
            GlobalData.logs.Add(new LogVO
            {
                message    = gameMgrProxy.systemDateTime.ToString("yyyy-MM-dd HH:mm:ss:ffff") + string.Format("发送消息 消息:{0} 消息号:{1} 消息体:{2}", msgNo.ToString(), msgNo.GetHashCode(), JsonMapper.ToJson(tbuff)),
                stackTrace = "",
                type       = LogType.Log,
            });

            if (GlobalData.logs.Count > GlobalData.maxLogs)
            {
                GlobalData.logs.RemoveAt(0);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 打印发送消息
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="tbuff"></param>
        public void ShowSendMsgLog <T>(MsgNoC2S msgNo, T tbuff, int clientIndex = 0)
        {
            var logVO = new LogVO();

            logVO.stackTrace = "";
            logVO.type       = LogType.Log;
            try
            {
                logVO.message = gameMgrProxy.systemDateTime.ToString("yyyy-MM-dd HH:mm:ss:ffff") + string.Format("发送消息 消息:{0} 消息号:{1} 消息体:{2} 客户端:{3}", msgNo.ToString(), msgNo.GetHashCode(), JsonMapper.ToJson(tbuff), clientIndex);
            }
            catch (Exception e)
            {
                Debug.LogError(string.Format("{0} {1}", e.Message, e.StackTrace));
            }
            GlobalData.logs.Add(logVO);

            if (GlobalData.logs.Count > GlobalData.maxLogs)
            {
                GlobalData.logs.RemoveAt(0);
            }
        }