Exemple #1
0
        /// <summary>
        /// 给出当前输入包ID的包属性
        /// </summary>
        /// <param name="iPacketID">数据包的ID</param>
        /// <returns>返回当前包ID的包属性</returns>
        public static PacketProfile GetIncomingProfile(long iPacketID)
        {
            if (OneServer.Profiling == false)
            {
                return(null);
            }

            PacketProfile packetProfile;

            s_IncomingProfiles.TryGetValue(iPacketID, out packetProfile);

            if (packetProfile == null)
            {
                s_IncomingProfiles[iPacketID] = packetProfile = new PacketProfile(false);
            }

            return(packetProfile);
        }
Exemple #2
0
        /// <summary>
        /// 给出当前输出包ID的包属性
        /// </summary>
        /// <param name="iPacketID">数据包的ID</param>
        /// <returns>返回当前包ID的包属性</returns>
        public static PacketProfile GetOutgoingProfile( long iPacketID )
        {
            if ( OneServer.Profiling == false )
                return null;

            PacketProfile packetProfile;
            s_OutgoingProfiles.TryGetValue( iPacketID, out packetProfile );

            if ( packetProfile == null )
                s_OutgoingProfiles[iPacketID] = packetProfile = new PacketProfile( true );

            return packetProfile;
        }