Ejemplo n.º 1
0
 public GetServersInfoHandler(IDbContextLocator dbContextLocator, IServerQueryFactory sqf,
                              IRequestScopeLocator scopeLocator)
     : base(dbContextLocator)
 {
     _sqf          = sqf;
     _scopeLocator = scopeLocator;
 }
Ejemplo n.º 2
0
 public async Task<BatchResult> GetServers(IServerQueryFactory factory, CancellationToken cancelToken,
     Action<List<IPEndPoint>> act) {
     var master = new SourceMasterQuery(ServerFilterBuilder.Build().FilterByGame("starbound").Value);
     return new BatchResult(await master.GetParsedServersObservable(cancelToken)
         .Do(x => act(x.Items))
         .SelectMany(x => x.Items)
         .Count());
 }
Ejemplo n.º 3
0
        public ServerQuery(IDatabaseGateway databaseGateway, IServerQueryFactory queryFactory)
        {
            Guard.AgainstNull(databaseGateway, nameof(databaseGateway));
            Guard.AgainstNull(queryFactory, nameof(queryFactory));

            _databaseGateway = databaseGateway;
            _queryFactory    = queryFactory;
        }
Ejemplo n.º 4
0
        public async Task <BatchResult> GetServers(IServerQueryFactory factory, CancellationToken cancelToken,
                                                   Action <List <IPEndPoint> > act)
        {
            var master = new SourceMasterQuery(ServerFilterBuilder.Build().FilterByGame("starbound").Value);

            return(new BatchResult(await master.GetParsedServersObservable(cancelToken)
                                   .Do(x => act(x.Items))
                                   .SelectMany(x => x.Items)
                                   .Count()));
        }
Ejemplo n.º 5
0
 public Task <BatchResult> GetServerInfos(IServerQueryFactory factory, IReadOnlyCollection <IPEndPoint> addresses,
                                          Action <Server> act, ServerQueryOptions options)
 => factory.Create(this).GetServerInfo(SteamInfo.AppId, addresses, options, act);
Ejemplo n.º 6
0
 public Task <BatchResult> GetServers(IServerQueryFactory factory, CancellationToken cancelToken, Action <List <IPEndPoint> > act)
 => factory.Create(this).GetServerAddresses(SteamInfo.AppId, act, cancelToken);
Ejemplo n.º 7
0
 public GetServerAddressesHandler(IDbContextLocator dbContextLocator, IServerQueryFactory sqf,
                                  IRequestScopeLocator scopeLoc) : base(dbContextLocator)
 {
     _sqf      = sqf;
     _scopeLoc = scopeLoc;
 }
Ejemplo n.º 8
0
 public Task <BatchResult> GetServerInfos(IServerQueryFactory factory, IReadOnlyCollection <IPEndPoint> addresses,
                                          Action <Server> act, ServerQueryOptions options)
 => GetFromGameServerQuery(addresses, options, act);
Ejemplo n.º 9
0
 public Task<BatchResult> GetServerInfos(IServerQueryFactory factory, IReadOnlyCollection<IPEndPoint> addresses,
         Action<Server> act, ServerQueryOptions options)
     => GetFromGameServerQuery(addresses, options, act);