Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 public PacketDecoder(INetworkBootstrap networkBootstrap, IPacketRegistry packetRegistry)
 {
     _networkBootstrap = networkBootstrap;
     _packetRegistry   = packetRegistry;
 }
 public DefaultPacketInboundHandler(INetworkBootstrap networkBootstrap, IPacketRegistry packetRegistry,
                                    IConnectionRegistry connectionRegistry, IPacketHandlerRegistry packetHandlerRegistry) : base(
         networkBootstrap, packetRegistry, connectionRegistry, packetHandlerRegistry)
 {
 }
 public void InitializePacketRegistry(IPropertyBag propertyBag, IStateMachine gameInstance)
 {
     PlexiglassPacketRegistry = new PlexiglassPacketRegistry(PacketDirectionality.CLIENT_TO_SERVER, propertyBag, gameInstance);
 }
Exemplo n.º 6
0
 public PacketEncoder(INetworkBootstrap bootstrap, IPacketRegistry registry)
 {
     _networkBootstrap = bootstrap;
     _packetRegistry   = registry;
 }