Ejemplo n.º 1
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());
 }
 public async Task<BatchResult> GetServerAddresses(uint appId, Action<List<IPEndPoint>> act,
     CancellationToken cancelToken) {
     var f = ServerFilterBuilder.Build()
         .FilterByGame("arma3");
     var master = new SourceMasterQuery(f.Value);
     return new BatchResult(await master.GetParsedServersObservable(cancelToken)
         .Do(x => act(x.Items))
         .SelectMany(x => x.Items)
         .Count());
 }