Пример #1
0
 public async Task<SpectateService.JsSpectatorThing> FindGame(dynamic args)
 {
     SpectateService.JsSpectatorThing jsSpectatorThing;
     string str = (string)args.realm;
     string str1 = (string)args.summonerName;
     PublicSummoner summoner = await JsApiService.GetSummoner(str, str1);
     if (summoner != null)
     {
         try
         {
             RiotAccount riotAccount = JsApiService.AccountBag.Get(str);
             PlatformGameLifecycleDTO spectatorGameThrowable = await SpectateService.GetSpectatorGameThrowable(str, str1);
             jsSpectatorThing = new SpectateService.JsSpectatorThing("in-game", spectatorGameThrowable.Game, riotAccount.RealmId, summoner.SummonerId, TimeSpan.FromSeconds((double)spectatorGameThrowable.ReconnectDelay));
         }
         catch (InvocationException invocationException)
         {
             string faultString = invocationException.FaultString;
             if (faultString == null)
             {
                 faultString = "";
             }
             string lowerInvariant = faultString.ToLowerInvariant();
             if (!lowerInvariant.Contains("not started"))
             {
                 jsSpectatorThing = (!lowerInvariant.Contains("not observable") ? new SpectateService.JsSpectatorThing("out-of-game") : new SpectateService.JsSpectatorThing("observer-disabled"));
             }
             else
             {
                 jsSpectatorThing = new SpectateService.JsSpectatorThing("game-assigned");
             }
         }
         catch
         {
             jsSpectatorThing = new SpectateService.JsSpectatorThing("error");
         }
     }
     else
     {
         jsSpectatorThing = new SpectateService.JsSpectatorThing("no-summoner");
     }
     return jsSpectatorThing;
 }
 public async Task<SpectateService.JsSpectatorThing> FindGame(object args)
 {
   // ISSUE: reference to a compiler-generated field
   if (SpectateService.\u003CFindGame\u003Eo__SiteContainer10.\u003C\u003Ep__Site11 == null)
   {
     // ISSUE: reference to a compiler-generated field
     SpectateService.\u003CFindGame\u003Eo__SiteContainer10.\u003C\u003Ep__Site11 = CallSite<Func<CallSite, object, string>>.Create(Binder.Convert(CSharpBinderFlags.ConvertExplicit, typeof (string), typeof (SpectateService)));
   }
   // ISSUE: reference to a compiler-generated field
   Func<CallSite, object, string> func1 = SpectateService.\u003CFindGame\u003Eo__SiteContainer10.\u003C\u003Ep__Site11.Target;
   // ISSUE: reference to a compiler-generated field
   CallSite<Func<CallSite, object, string>> callSite1 = SpectateService.\u003CFindGame\u003Eo__SiteContainer10.\u003C\u003Ep__Site11;
   // ISSUE: reference to a compiler-generated field
   if (SpectateService.\u003CFindGame\u003Eo__SiteContainer10.\u003C\u003Ep__Site12 == null)
   {
     // ISSUE: reference to a compiler-generated field
     SpectateService.\u003CFindGame\u003Eo__SiteContainer10.\u003C\u003Ep__Site12 = CallSite<Func<CallSite, object, object>>.Create(Binder.GetMember(CSharpBinderFlags.None, "realm", typeof (SpectateService), (IEnumerable<CSharpArgumentInfo>) new CSharpArgumentInfo[1]
     {
       CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string) null)
     }));
   }
   // ISSUE: reference to a compiler-generated field
   // ISSUE: reference to a compiler-generated field
   object obj1 = SpectateService.\u003CFindGame\u003Eo__SiteContainer10.\u003C\u003Ep__Site12.Target((CallSite) SpectateService.\u003CFindGame\u003Eo__SiteContainer10.\u003C\u003Ep__Site12, args);
   string realm = func1((CallSite) callSite1, obj1);
   // ISSUE: reference to a compiler-generated field
   if (SpectateService.\u003CFindGame\u003Eo__SiteContainer10.\u003C\u003Ep__Site13 == null)
   {
     // ISSUE: reference to a compiler-generated field
     SpectateService.\u003CFindGame\u003Eo__SiteContainer10.\u003C\u003Ep__Site13 = CallSite<Func<CallSite, object, string>>.Create(Binder.Convert(CSharpBinderFlags.ConvertExplicit, typeof (string), typeof (SpectateService)));
   }
   // ISSUE: reference to a compiler-generated field
   Func<CallSite, object, string> func2 = SpectateService.\u003CFindGame\u003Eo__SiteContainer10.\u003C\u003Ep__Site13.Target;
   // ISSUE: reference to a compiler-generated field
   CallSite<Func<CallSite, object, string>> callSite2 = SpectateService.\u003CFindGame\u003Eo__SiteContainer10.\u003C\u003Ep__Site13;
   // ISSUE: reference to a compiler-generated field
   if (SpectateService.\u003CFindGame\u003Eo__SiteContainer10.\u003C\u003Ep__Site14 == null)
   {
     // ISSUE: reference to a compiler-generated field
     SpectateService.\u003CFindGame\u003Eo__SiteContainer10.\u003C\u003Ep__Site14 = CallSite<Func<CallSite, object, object>>.Create(Binder.GetMember(CSharpBinderFlags.None, "summonerName", typeof (SpectateService), (IEnumerable<CSharpArgumentInfo>) new CSharpArgumentInfo[1]
     {
       CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, (string) null)
     }));
   }
   // ISSUE: reference to a compiler-generated field
   // ISSUE: reference to a compiler-generated field
   object obj2 = SpectateService.\u003CFindGame\u003Eo__SiteContainer10.\u003C\u003Ep__Site14.Target((CallSite) SpectateService.\u003CFindGame\u003Eo__SiteContainer10.\u003C\u003Ep__Site14, args);
   string summonerName = func2((CallSite) callSite2, obj2);
   PublicSummoner summoner = await JsApiService.GetSummoner(realm, summonerName);
   SpectateService.JsSpectatorThing jsSpectatorThing;
   if (summoner != null)
   {
     try
     {
       RiotAccount account = JsApiService.AccountBag.Get(realm);
       PlatformGameLifecycleDTO game = await SpectateService.GetSpectatorGameThrowable(realm, summonerName);
       jsSpectatorThing = new SpectateService.JsSpectatorThing("in-game", game.Game, account.RealmId, summoner.SummonerId, TimeSpan.FromSeconds((double) game.ReconnectDelay));
     }
     catch (InvocationException ex)
     {
       string str = (ex.FaultString ?? "").ToLowerInvariant();
       jsSpectatorThing = !str.Contains("not started") ? (!str.Contains("not observable") ? new SpectateService.JsSpectatorThing("out-of-game") : new SpectateService.JsSpectatorThing("observer-disabled")) : new SpectateService.JsSpectatorThing("game-assigned");
     }
     catch
     {
       jsSpectatorThing = new SpectateService.JsSpectatorThing("error");
     }
   }
   else
     jsSpectatorThing = new SpectateService.JsSpectatorThing("no-summoner");
   return jsSpectatorThing;
 }