public ActionNotifierDecorator(IMediator decorated, IDbContextLocator locator, IGameSwitcher gameSwitcher, INetworkContentSyncer networkSyncer) : base(decorated) { _locator = locator; _gameSwitcher = gameSwitcher; _networkSyncer = networkSyncer; }
public SetupGameStuff(IDbContextLocator locator, IDbContextFactory factory, INetworkContentSyncer networkContentSyncer, /* ICacheManager cacheMan, */ IGameLocker gameLocker, IStateHandler stateHandler, IAssemblyService ass) { _locator = locator; _factory = factory; _networkContentSyncer = networkContentSyncer; //_cacheMan = cacheMan; _gameLocker = gameLocker; _stateHandler = stateHandler; _timer = new TimerWithElapsedCancellationAsync(TimeSpan.FromMinutes(30), onElapsedNonBool: OnElapsed); _gameFactory = new GameFactory(ass); }
public static async Task DealWithCollections(Game game, IEnumerable <ContentGuidSpec> contents, INetworkContentSyncer networkContentSyncer) { var ids = contents.Select(x => x.Id).ToArray(); var existingCollections = game.SubscribedCollections.Where(x => ids.Contains(x.Id)).ToList(); var newCollectionIds = ids.Except(existingCollections.Select(x => x.Id)).ToList(); await networkContentSyncer.SyncCollections(existingCollections).ConfigureAwait(false); if (newCollectionIds.Any()) { var newCollections = await networkContentSyncer.GetCollections(game.Id, newCollectionIds).ConfigureAwait(false); game.Contents.AddRange(newCollections); } }
public SyncCollectionsHandler(IDbContextLocator dbContextLocator, INetworkContentSyncer contentSyncer) : base(dbContextLocator) { _contentSyncer = contentSyncer; }
public Task Synchronize(Game game, INetworkContentSyncer syncer) => SyncCollectionsHandler.DealWithCollections(game, new[] { Content }, syncer);
public CollectionSyncer(ICollectionInfoFetcher collectionInfoFetcher, INetworkContentSyncer syncer, IW6Api api) { _collectionInfoFetcher = collectionInfoFetcher; _syncer = syncer; _api = api; }
public SetupGameStuff(IDbContextLocator gameContextFactory, INetworkContentSyncer networkContentSyncer) { _gameContextFactory = gameContextFactory; _networkContentSyncer = networkContentSyncer; }