コード例 #1
0
        /// <summary>
        /// Construct the net client with the given packet manager.
        /// </summary>
        /// <param name="packetManager">The packet manager instance.</param>
        public NetClient(PacketManager packetManager)
        {
            _packetManager = packetManager;

            _udpNetClient = new UdpNetClient();

            // Register the same function for both TCP and UDP receive callbacks
            _udpNetClient.RegisterOnReceive(OnReceiveData);
        }
コード例 #2
0
 /// <summary>
 /// Construct the update manager with a UDP net client.
 /// </summary>
 /// <param name="udpNetClient">The UDP net client for the local client.</param>
 public ClientUpdateManager(UdpNetClient udpNetClient) : base(udpNetClient.UdpClient)
 {
 }