Пример #1
0
 public ContainerResourceManager(IUpdateHub updateHub, IExtensionResolver extensionResolver, IDefinitionManager definitionManager, ISettings settings)
 {
     UpdateHub = updateHub;
     this.extensionResolver = extensionResolver;
     this.definitionManager = definitionManager;
     this.settings          = settings;
 }
Пример #2
0
 static NotificationCommands()
 {
     updateHub = TypeContainer.Get <IUpdateHub>();
     entityNotificationPool        = TypeContainer.Get <IPool <EntityNotification> >();
     blockChangedNotificationPool  = TypeContainer.Get <IPool <BlockChangedNotification> >();
     blocksChangedNotificationPool = TypeContainer.Get <IPool <BlocksChangedNotification> >();
 }
Пример #3
0
 public NetworkUpdateManager(Client client, IUpdateHub updateHub, IDefinitionManager manager)
 {
     this.client        = client;
     this.updateHub     = updateHub;
     hubSubscription    = updateHub.Subscribe(this, DefaultChannels.Network);
     clientSubscription = client.Subscribe(this);
     definitionManager  = manager;
 }
Пример #4
0
        public ServerHandler(ISettings settings)
        {
            logger = LogManager.GetCurrentClassLogger();

            var updateHub = new UpdateHub();

            UpdateHub = updateHub;

            server = new Server();

            SimulationManager = new SimulationManager(settings, updateHub);
            defaultManager    = new DefaultCommandManager <ushort, CommandParameter, byte[]>(typeof(ServerHandler).Namespace + ".Commands");
        }
Пример #5
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);
        }
Пример #6
0
        public ServerHandler()
        {
            logger = (TypeContainer.GetOrNull <ILogger>() ?? NullLogger.Default).As(typeof(ServerHandler));

            TypeContainer.Register <UpdateHub>(InstanceBehaviour.Singleton);
            TypeContainer.Register <IUpdateHub, UpdateHub>(InstanceBehaviour.Singleton);
            TypeContainer.Register <Server>(InstanceBehaviour.Singleton);
            TypeContainer.Register <SimulationManager>(InstanceBehaviour.Singleton);

            SimulationManager = TypeContainer.Get <SimulationManager>();
            UpdateHub         = TypeContainer.Get <IUpdateHub>();
            server            = TypeContainer.Get <Server>();

            defaultManager = new DefaultCommandManager <ushort, CommandParameter, byte[]>(typeof(ServerHandler).Namespace + ".Commands");
        }
Пример #7
0
 public ContainerResourceManager()
 {
     UpdateHub = new UpdateHub();
 }
Пример #8
0
 public void InsertUpdateHub(IUpdateHub updateHub) => throw new NotImplementedException();
Пример #9
0
 public void InsertUpdateHub(IUpdateHub updateHub)
 => this.updateHub = updateHub;
Пример #10
0
 public DiskPersistenceManager(IExtensionResolver extensionResolver, ISettings Settings, IUpdateHub updateHub)
 {
     this.extensionResolver = extensionResolver;
     settings                     = Settings;
     databaseProvider             = new DatabaseProvider(GetRoot(), TypeContainer.Get <ILogger>());
     awaiterPool                  = TypeContainer.Get <IPool <Awaiter> >();
     blockChangedNotificationPool = TypeContainer.Get <IPool <BlockChangedNotification> >();
     chunkSubscription            = updateHub.Subscribe(this, DefaultChannels.Chunk);
 }
Пример #11
0
 static NotificationCommands()
 {
     updateHub = Program.ServerHandler.UpdateHub;
 }
Пример #12
0
 static PlayerCommands()
 {
     updateHub = Program.ServerHandler.UpdateHub;
 }