コード例 #1
0
 public GetServersHandler(ISteamApi steamApi, IMessageBusProxy mb, IRequestScopeLocator scopeLocator,
                          ISteamSessionLocator sessionLocator)
 {
     _steamApi       = steamApi;
     _mb             = mb;
     _scopeLocator   = scopeLocator;
     _sessionLocator = sessionLocator;
 }
コード例 #2
0
 private Task Run(CancellationToken ct) {
     if (AppId == (uint) SteamGameIds.Arma3) {
         return SteamActions.PerformArmaSteamAction(async api => {
             SteamApi = api;
             await RunWebsite(ct).ConfigureAwait(false);
         }, (uint) SteamGameIds.Arma3, _steamSessionFactory);
     }
     SteamApi = new DummyApi();
     return DoWithSteamSession(() => RunWebsite(ct));
 }
コード例 #3
0
 private Task Run(CancellationToken ct)
 {
     if (AppId == (uint)SteamGameIds.Arma3)
     {
         return(SteamActions.PerformArmaSteamAction(async api => {
             SteamApi = api;
             await RunWebsite(ct).ConfigureAwait(false);
         }, (uint)SteamGameIds.Arma3, _steamSessionFactory));
     }
     SteamApi = new DummyApi();
     return(DoWithSteamSession(() => RunWebsite(ct)));
 }
コード例 #4
0
 private static async Task<IList<ArmaServerInfo>> PerformAction(ISteamApi steamApi, ServerFilterWrap filter) {
     using (var sb = await SteamActions.CreateServerBrowser(steamApi).ConfigureAwait(false)) {
         using (var cts = new CancellationTokenSource()) {
             var obs =
                 await
                     sb.GetServersInclDetails(cts.Token, filter, true)
                         .ConfigureAwait(false);
             var s = await obs.Take(10).ToList();
             cts.Cancel();
             return s;
         }
     }
 }
コード例 #5
0
ファイル: ServersTest.cs プロジェクト: dkv01/withSIX.Desktop
        private static async Task <IList <ArmaServerInfo> > PerformAction(ISteamApi steamApi, ServerFilterWrap filter)
        {
            using (var sb = await SteamActions.CreateServerBrowser(steamApi).ConfigureAwait(false)) {
                using (var cts = new CancellationTokenSource()) {
                    var obs =
                        await
                        sb.GetServersInclDetails(cts.Token, filter, true)
                        .ConfigureAwait(false);

                    var s = await obs.Take(10).ToList();

                    cts.Cancel();
                    return(s);
                }
            }
        }
コード例 #6
0
 public GetServersSession(ISteamApi steamApi, IMessageBusProxy mb, IRequestScope scope,
                          ISteamSessionLocator sessionLocator) : base(mb, scope, sessionLocator)
 {
     _steamApi = steamApi;
 }