コード例 #1
0
 internal NetConnection(NetBase parent, IPEndPoint remote)
 {
     m_parent                = parent;
     m_remoteEndpoint        = remote;
     m_nextSequenceNumber    = new ushort[NetConstants.NumSequenceChannels];
     m_sequenceHandler       = new NetSequenceHandler();
     m_unsentMessages        = new Queue <NetMessage>(10);
     m_receivedMessages      = new Queue <NetMessage>(10);
     m_withheldMessages      = new List <NetMessage>();
     m_unsentAcknowledges    = new Queue <NetMessage>(10);
     m_lastHeardFromRemote   = (float)NetTime.Now;
     m_reusedAckMessage      = new NetMessage(NetMessageType.Acknowledge, null);
     m_savedReliableMessages = new List <NetMessage> [NetConstants.NumSequenceChannels];
     Configuration           = new NetConnectionConfiguration(this);
     m_ping        = new NetPing(this);
     Statistics    = new NetStatistics(this);
     m_stringTable = new NetStringTable();
     m_encryption  = new NetEncryption();
     if (parent.Configuration.UsesEncryption)
     {
         m_encryption.SetRSAKey(parent.Configuration.ServerPublicKeyBytes, parent.Configuration.ServerPrivateKeyBytes);
     }
 }
コード例 #2
0
		internal NetConnection(NetBase parent, IPEndPoint remote)
		{
			m_parent = parent;
			m_remoteEndpoint = remote;
			m_nextSequenceNumber = new ushort[NetConstants.NumSequenceChannels];
			m_sequenceHandler = new NetSequenceHandler();
			m_unsentMessages = new Queue<NetMessage>(10);
			m_receivedMessages = new Queue<NetMessage>(10);
			m_withheldMessages = new List<NetMessage>();
			m_unsentAcknowledges = new Queue<NetMessage>(10);
			m_lastHeardFromRemote = (float)NetTime.Now;
			m_reusedAckMessage = new NetMessage(NetMessageType.Acknowledge, null);
			m_savedReliableMessages = new List<NetMessage>[NetConstants.NumSequenceChannels];
			Configuration = new NetConnectionConfiguration(this);
			m_ping = new NetPing(this);
			Statistics = new NetStatistics(this);
			m_stringTable = new NetStringTable();
			m_encryption = new NetEncryption();
			if (parent.Configuration.UsesEncryption)
				m_encryption.SetRSAKey(parent.Configuration.ServerPublicKeyBytes, parent.Configuration.ServerPrivateKeyBytes);
		}