Exemplo n.º 1
0
 public MangosNetworkLog(NetworkLogMode mode)
     : base(mode)
 {
     if (mode == NetworkLogMode.Writing)
     {
         throw new NotSupportedException();
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of <see cref="Kamilla.Network.Logging.NetworkLog"/> class
 /// in the specified <see cref="Kamilla.Network.Logging.NetworkLogMode"/>.
 /// </summary>
 /// <param name="mode">
 /// The <see cref="Kamilla.Network.Logging.NetworkLogMode"/> in which
 /// to open the <see cref="Kamilla.Network.Logging.NetworkLog"/>.
 /// </param>
 /// <exception cref="System.ArgumentException">
 /// mode is invalid.
 /// </exception>
 public NetworkLog(NetworkLogMode mode)
 {
     switch (mode)
     {
         case NetworkLogMode.Abstract:
         case NetworkLogMode.Reading:
             m_packets = new List<Packet>();
             break;
         case NetworkLogMode.Writing:
             if (this is IHasStartTicks)
                 ((IHasStartTicks)this).StartTicks = (uint)Environment.TickCount;
             if (this is IHasStartTime)
                 ((IHasStartTime)this).StartTime = DateTime.Now;
             break;
         default:
             throw new ArgumentException("mode");
     }
 }
Exemplo n.º 3
0
        public NetworkLog Activate(NetworkLogMode mode)
        {
            if (IsReadOnly)
            {
                if (mode == NetworkLogMode.Writing)
                    throw new NotSupportedException("This dump reading class does not support writing data.");

                mode = NetworkLogMode.Abstract;
            }

            try
            {
                return (NetworkLog)Activator.CreateInstance(m_type, mode);
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: [NetworkLogWrapper] Failed to activate a new instance of {0} with mode {1}: {2}",
                    m_type, mode, e);

                return null;
            }
        }
Exemplo n.º 4
0
        public NetworkLog Activate(NetworkLogMode mode)
        {
            if (IsReadOnly)
            {
                if (mode == NetworkLogMode.Writing)
                {
                    throw new NotSupportedException("This dump reading class does not support writing data.");
                }

                mode = NetworkLogMode.Abstract;
            }

            try
            {
                return((NetworkLog)Activator.CreateInstance(m_type, mode));
            }
            catch (Exception e)
            {
                Console.WriteLine("Error: [NetworkLogWrapper] Failed to activate a new instance of {0} with mode {1}: {2}",
                                  m_type, mode, e);

                return(null);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of <see cref="Kamilla.Network.Logging.NetworkLog"/> class
        /// in the specified <see cref="Kamilla.Network.Logging.NetworkLogMode"/>.
        /// </summary>
        /// <param name="mode">
        /// The <see cref="Kamilla.Network.Logging.NetworkLogMode"/> in which
        /// to open the <see cref="Kamilla.Network.Logging.NetworkLog"/>.
        /// </param>
        /// <exception cref="System.ArgumentException">
        /// mode is invalid.
        /// </exception>
        public NetworkLog(NetworkLogMode mode)
        {
            switch (mode)
            {
            case NetworkLogMode.Abstract:
            case NetworkLogMode.Reading:
                m_packets = new List <Packet>();
                break;

            case NetworkLogMode.Writing:
                if (this is IHasStartTicks)
                {
                    ((IHasStartTicks)this).StartTicks = (uint)Environment.TickCount;
                }
                if (this is IHasStartTime)
                {
                    ((IHasStartTime)this).StartTime = DateTime.Now;
                }
                break;

            default:
                throw new ArgumentException("mode");
            }
        }
Exemplo n.º 6
0
 public WowNetworkLog(NetworkLogMode mode)
     : base(mode)
 {
 }
Exemplo n.º 7
0
 public Pkt31NetworkLog(NetworkLogMode mode)
     : base(mode)
 {
 }
Exemplo n.º 8
0
 public TrinityNetworkLog(NetworkLogMode mode)
     : base(mode)
 {
     if (mode == NetworkLogMode.Writing)
         throw new NotSupportedException();
 }
Exemplo n.º 9
0
 public Pkt31NetworkLog(NetworkLogMode mode)
     : base(mode)
 {
 }
Exemplo n.º 10
0
 public Krpd2NetworkLog(NetworkLogMode mode)
     : base(mode)
 {
 }
Exemplo n.º 11
0
 public KrpdNetworkLog(NetworkLogMode mode)
     : base(mode)
 {
 }