Exemplo n.º 1
0
        public void DeserializeAndRoutePacket(int nodeId, NodePacketType packetType, ITranslator translator)
        {
            if (packetType == NodePacketType.NodeShutdown)
            {
                RemoveNodeFromMapping(nodeId);
            }

            _packetFactory.DeserializeAndRoutePacket(nodeId, packetType, translator);
        }
Exemplo n.º 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, INodePacketTranslator translator)
 {
     if (_nodeIdToPacketFactory.ContainsKey(nodeId))
     {
         _nodeIdToPacketFactory[nodeId].DeserializeAndRoutePacket(nodeId, packetType, translator);
     }
     else
     {
         _localPacketFactory.DeserializeAndRoutePacket(nodeId, packetType, translator);
     }
 }
Exemplo n.º 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)
 {
     if (_nodeIdToPacketFactory.TryGetValue(nodeId, out INodePacketFactory nodePacketFactory))
     {
         nodePacketFactory.DeserializeAndRoutePacket(nodeId, packetType, translator);
     }
     else
     {
         _localPacketFactory.DeserializeAndRoutePacket(nodeId, packetType, translator);
     }
 }
Exemplo n.º 4
0
 public void DeserializeAndRoutePacket(int nodeId, NodePacketType packetType, ITranslator translator)
 {
     _packetFactory.DeserializeAndRoutePacket(nodeId, packetType, translator);
 }