Example #1
0
 public ChunkHandler(long battleId, ChunkSettings chunkSettings, ChunkKey chunkKey, IChunklerClient chunklerClient)
 {
     _chunkKey            = chunkKey;
     _chunkSettings       = chunkSettings ?? throw new ArgumentNullException(nameof(chunkSettings));
     _chunklerClient      = chunklerClient ?? throw new ArgumentNullException(nameof(chunklerClient));
     _subscriptions       = new ConcurrentDictionary <IChunkHandlerSubscription, Func <ChunkKey, ChunkUpdate, Task> >();
     _lastUpdatedTicksUTC = DateTime.MinValue.Ticks;
     _subscriptionCounter = 0;
     _battleId            = battleId;
 }
Example #2
0
        public async Task <ChunkHandler> CreateChunkHandlerAsync(long battleId, ChunkSettings chunkSettings, ChunkKey chunkKey, IChunklerClient chunklerClient)
        {
            var handler = new ChunkHandler(battleId, chunkSettings, chunkKey, chunklerClient);
            await handler.SubscribeToChunkAsync();

            return(handler);
        }