Пример #1
0
 public DataMaintenance(
     IPlayerLocationsRepository playerLocationsRepository,
     IPlayersCacheRepository playersCache,
     IGameServerStatusStatsRepository gameServerStatusStatsRepository,
     AzureTableLogger azureTableLogger)
 {
     _playerLocationsRepository = playerLocationsRepository ?? throw new ArgumentNullException(nameof(playerLocationsRepository));
     _playersCache = playersCache ?? throw new ArgumentNullException(nameof(playersCache));
     _gameServerStatusStatsRepository = gameServerStatusStatsRepository;
     _azureTableLogger = azureTableLogger ?? throw new ArgumentNullException(nameof(azureTableLogger));
 }
Пример #2
0
 public ServersController(
     IGameServersRepository gameServersRepository,
     IGameServerStatusRepository gameServerStatusRepository,
     IMapsRepository mapsRepository,
     IPlayerLocationsRepository playerLocationsRepository,
     IGameServerStatusStatsRepository gameServerStatusStatsRepository)
 {
     _gameServersRepository           = gameServersRepository ?? throw new ArgumentNullException(nameof(gameServersRepository));
     _gameServerStatusRepository      = gameServerStatusRepository ?? throw new ArgumentNullException(nameof(gameServerStatusRepository));
     _mapsRepository                  = mapsRepository ?? throw new ArgumentNullException(nameof(mapsRepository));
     _playerLocationsRepository       = playerLocationsRepository ?? throw new ArgumentNullException(nameof(playerLocationsRepository));
     _gameServerStatusStatsRepository = gameServerStatusStatsRepository ?? throw new ArgumentNullException(nameof(gameServerStatusStatsRepository));
 }
        public GameServerStatusRepository(IGameServerStatusRepositoryOptions options,
                                          IGameServersRepository gameServersRepository,
                                          IGameServerClientFactory gameServerClientFactory,
                                          IGeoLocationClient geoLocationClient,
                                          IPlayerLocationsRepository playersLocationsRepository)
        {
            _gameServersRepository      = gameServersRepository ?? throw new ArgumentNullException(nameof(gameServersRepository));
            _gameServerClientFactory    = gameServerClientFactory ?? throw new ArgumentNullException(nameof(gameServerClientFactory));
            _geoLocationClient          = geoLocationClient ?? throw new ArgumentNullException(nameof(geoLocationClient));
            _playersLocationsRepository = playersLocationsRepository ?? throw new ArgumentNullException(nameof(playersLocationsRepository));
            var storageAccount   = CloudStorageAccount.Parse(options.StorageConnectionString);
            var cloudTableClient = storageAccount.CreateCloudTableClient();

            _statusTable = cloudTableClient.GetTableReference(options.StorageTableName);
            _statusTable.CreateIfNotExistsAsync().Wait();
        }