/// <summary>
		/// Constructs a new PacketProcessor
		/// </summary>
		/// <param name="client">The processor client</param>
		public PacketProcessor(GameClient client)
		{
			if (client == null)
				throw new ArgumentNullException("client");
			m_client = client;
			m_udpCounter = 0;
			//TODO set encoding based on client version in the future :)
			m_encoding = new PacketEncoding168();
			m_asyncUdpCallback = new AsyncCallback(AsyncUdpSendCallback);
			m_tcpSendBuffer = client.Server.AcquirePacketBuffer();
			m_udpSendBuffer = client.Server.AcquirePacketBuffer();
		}
Beispiel #2
0
 /// <summary>
 /// Constructs a new PacketProcessor
 /// </summary>
 /// <param name="client">The processor client</param>
 public PacketProcessor(GameClient client)
 {
     if (client == null)
     {
         throw new ArgumentNullException("client");
     }
     m_client     = client;
     m_udpCounter = 0;
     //TODO set encoding based on client version in the future :)
     m_encoding         = new PacketEncoding168();
     m_asyncUdpCallback = new AsyncCallback(AsyncUdpSendCallback);
     m_tcpSendBuffer    = client.Server.AcquirePacketBuffer();
     m_udpSendBuffer    = client.Server.AcquirePacketBuffer();
 }
Beispiel #3
0
        /// <summary>
        /// Constructs a new PacketProcessor
        /// </summary>
        /// <param name="client">The processor client</param>
        public PacketProcessor(GameClient client)
		{
			if (client == null)
				throw new ArgumentNullException("client");
			m_client = client;
            m_packetPreprocessor = new PacketPreprocessing();

            LoadPacketHandlers(client);

            m_udpCounter = 0;
			//TODO set encoding based on client version in the future :)
			if (client.Version < GameClient.eClientVersion.Version1110)
				m_encoding = new PacketEncoding168();
			else
				m_encoding = new PacketEncoding1110();

			m_asyncUdpCallback = new AsyncCallback(AsyncUdpSendCallback);
			m_tcpSendBuffer = client.Server.AcquirePacketBuffer();
			m_udpSendBuffer = new byte[512]; // we want a smaller maximum size packet for UDP
		}