예제 #1
0
        public void RecordSendPack(ushort protocol, object pack)
        {
            if (!IsEnableRecord() && !IsEnableLogFile())
            {
                return;
            }

            System.Type pack_type;
            if (Protocol2SendType.TryGetValue(protocol, out pack_type))
            {
                var pack_data = new PackData(protocol, pack, PackData.EPackType.Send, pack_type);

                OnLogPackData(pack_data);

#if UNITY_EDITOR
                bool not_record = false;
                if (NotRecordDict.TryGetValue(protocol, out not_record) && not_record)
                {
                    return;
                }
                RecvedPackList.Add(pack_data);
                OnRecordPackData(pack_data);
#endif
            }
        }
예제 #2
0
        public void RecordRecvPack(ushort protocol, byte[] data)
        {
            if (!IsEnableRecord() && !IsEnableLogFile())
            {
                return;
            }

            System.Type pack_type;
            if (Protocol2RecvType.TryGetValue(protocol, out pack_type))
            {
                var pack      = Net.S2CPackBase.DeserializePack(data, pack_type);
                var pack_data = new PackData(protocol, pack, PackData.EPackType.Recv, pack_type);

                OnLogPackData(pack_data);

#if UNITY_EDITOR
                bool not_record = false;
                if (NotRecordDict.TryGetValue(protocol, out not_record) && not_record)
                {
                    return;
                }
                RecvedPackList.Add(pack_data);
                OnRecordPackData(pack_data);
#endif
            }
        }