protected PacketHandler(INetworkBootstrap networkBootstrap, IPacketHandlerRegistry packetHandlerRegistry, IConnectionRegistry connectionRegistry, IConnection connection) { NetworkBootstrap = networkBootstrap; PacketHandlerRegistry = packetHandlerRegistry; ConnectionRegistry = connectionRegistry; Connection = connection; }
protected PacketInboundHandler(INetworkBootstrap networkBootstrap, IPacketRegistry packetRegistry, IConnectionRegistry connectionRegistry, IPacketHandlerRegistry packetHandlerRegistry) { _networkBootstrap = networkBootstrap ?? throw new ArgumentNullException(nameof(networkBootstrap)); _packetRegistry = packetRegistry ?? throw new ArgumentNullException(nameof(packetRegistry)); _connectionRegistry = connectionRegistry ?? throw new ArgumentNullException(nameof(connectionRegistry)); _packetHandlerRegistry = packetHandlerRegistry ?? throw new ArgumentNullException(nameof(packetHandlerRegistry)); }
public DefaultBootstrap(BootstrapTypeEnum bootstrapType, TimeSpan packetHandlerTickingInterval, IConnectionRegistry connectionRegistry = null, IPacketRegistry packetRegistry = null, IPacketHandlerRegistry packetHandlerRegistry = null, Type inboundHandlerType = null) { _inboundHandlerType = inboundHandlerType ?? typeof(DefaultPacketInboundHandler); if (!typeof(PacketInboundHandler).IsAssignableFrom(_inboundHandlerType)) { throw new ArgumentException( $"{_inboundHandlerType.FullName} is not assignable from {typeof(PacketInboundHandler).FullName}"); } BootstrapType = bootstrapType; _packetHandlerTickingInterval = packetHandlerTickingInterval.TotalMilliseconds; ConnectionRegistry = connectionRegistry ?? new DefaultConnectionRegistry(); PacketRegistry = packetRegistry ?? new DefaultPacketRegistry(); PacketHandlerRegistry = packetHandlerRegistry ?? new DefaultPacketHandlerRegistry(this, ConnectionRegistry); }
public DefaultPacketInboundHandler(INetworkBootstrap networkBootstrap, IPacketRegistry packetRegistry, IConnectionRegistry connectionRegistry, IPacketHandlerRegistry packetHandlerRegistry) : base( networkBootstrap, packetRegistry, connectionRegistry, packetHandlerRegistry) { }
public PacketHandler(INetworkBootstrap networkBootstrap, IPacketHandlerRegistry packetHandlerRegistry, IConnectionRegistry connectionRegistry, IConnection connection) : base(networkBootstrap, packetHandlerRegistry, connectionRegistry, connection) { }