public NetworkPersistenceManager(Client client)
        {
            this.client  = client;
            subscription = client.Subscribe(this);

            packages    = new ConcurrentDictionary <uint, Awaiter>();
            logger      = (TypeContainer.GetOrNull <ILogger>() ?? NullLogger.Default).As(typeof(NetworkPersistenceManager));
            awaiterPool = TypeContainer.Get <IPool <Awaiter> >();
            packagePool = TypeContainer.Get <PackagePool>();
        }
Exemplo n.º 2
0
        public NetworkUpdateManager(Client client, IUpdateHub updateHub)
        {
            this.client    = client;
            this.updateHub = updateHub;

            logger = (TypeContainer.GetOrNull <ILogger>() ?? NullLogger.Default).As(typeof(NetworkUpdateManager));
            entityNotificationPool        = TypeContainer.Get <IPool <EntityNotification> >();
            blockChangedNotificationPool  = TypeContainer.Get <IPool <BlockChangedNotification> >();
            blocksChangedNotificationPool = TypeContainer.Get <IPool <BlocksChangedNotification> >();
            packagePool = TypeContainer.Get <PackagePool>();

            hubSubscription    = updateHub.Subscribe(this, DefaultChannels.Network);
            clientSubscription = client.Subscribe(this);
        }
Exemplo n.º 3
0
 public void Return(ref Package pkg)
 {
     PackagePool.Return(ref pkg);
 }
Exemplo n.º 4
0
 public ConnectedClient(Socket socket) : base(socket)
 {
     packagePool = TypeContainer.Get <PackagePool>();
 }