protected override void InitializeDistributedService() { base.InitializeDistributedService(); SendMessages = true; ShardAddModel = CreateShardChannel <AddModel>(); ShardRemoveModel = CreateShardChannel <RemoveModel>(); ShardUpdateModel = CreateShardChannel <UpdateModel>(); ShardUpdateSet = CreateShardChannel <UpdateSet>(); ShardAddModel.Receive += addModel; ShardRemoveModel.Receive += removeModel; ShardUpdateModel.Receive += updateModel; ShardUpdateSet.Receive += updateSet; UserAddModel = CreateUserChannel <AddModel>(); UserRemoveModel = CreateUserChannel <RemoveModel>(); UserUpdateModel = CreateUserChannel <UpdateModel>(); UserUpdateSet = CreateUserChannel <UpdateSet>(); UserAddModel.Receive += addModel; UserRemoveModel.Receive += removeModel; UserUpdateModel.Receive += updateModel; UserUpdateSet.Receive += updateSet; Models = new ModelTrackerCollection <TModel>(); Models.ModelAddedEvent += OnModelAdded; Models.ModelRemovedEvent += OnModelRemoved; Models.ModelUpdatedEvent += OnModelUpdated; if (IsRouter) { RouterController.ShardController.NetUserConnected += OnShardConnected; RouterController.UserController.NetUserConnected += OnUserConnected; } }
protected override void InitializeDistributedService() { base.InitializeDistributedService(); ShardChannel = CreateShardChannel <TestPacket>(); }