示例#1
0
        /// <summary>
        /// Takes a serializer, deserializes the packet and routes it to the appropriate handler.
        /// </summary>
        /// <param name="nodeId">The node from which the packet was received.</param>
        /// <param name="packetType">The packet type.</param>
        /// <param name="translator">The translator containing the data from which the packet should be reconstructed.</param>
        public void DeserializeAndRoutePacket(int nodeId, NodePacketType packetType, ITranslator translator)
        {
            if (packetType == NodePacketType.NodeShutdown)
            {
                RemoveNodeFromMapping(nodeId);
            }

            _packetFactory.DeserializeAndRoutePacket(nodeId, packetType, translator);
        }
示例#2
0
 /// <summary>
 /// Takes a serializer, deserializes the packet and routes it to the appropriate handler.
 /// </summary>
 /// <param name="nodeId">The node from which the packet was received.</param>
 /// <param name="packetType">The packet type.</param>
 /// <param name="translator">The translator containing the data from which the packet should be reconstructed.</param>
 public void DeserializeAndRoutePacket(int nodeId, NodePacketType packetType, ITranslator translator)
 {
     if (_nodeIdToPacketFactory.ContainsKey(nodeId))
     {
         _nodeIdToPacketFactory[nodeId].DeserializeAndRoutePacket(nodeId, packetType, translator);
     }
     else
     {
         _localPacketFactory.DeserializeAndRoutePacket(nodeId, packetType, translator);
     }
 }
示例#3
0
 /// <summary>
 /// Takes a serializer, deserializes the packet and routes it to the appropriate handler.
 /// </summary>
 /// <param name="nodeId">The node from which the packet was received.</param>
 /// <param name="packetType">The packet type.</param>
 /// <param name="translator">The translator containing the data from which the packet should be reconstructed.</param>
 public void DeserializeAndRoutePacket(int nodeId, NodePacketType packetType, ITranslator translator)
 {
     _packetFactory.DeserializeAndRoutePacket(nodeId, packetType, translator);
 }