示例#1
0
 private void CheckOnChampSelect(object s, Session session)
 {
     try
     {
         var SummonerId = leagueAPI.Login.GetSession()?.SummonerId;
         if (SummonerId == null)
         {
             return;
         }
         var ActorCellId = session.MyTeam.FirstOrDefault(t => t.SummonerId == SummonerId)?.CellId;
         if (session.Actions.Count == 0)
         {
             return;
         }
         var myActions = session.Actions.Select(t => t.FirstOrDefault(c => c.ActorCellId == ActorCellId));
         var Action    = myActions?.FirstOrDefault(t => t != null && t.IsInProgress);
         if (Action == null)
         {
             return;
         }
         if (Action.Id != actionId)
         {
             shouldNotifyPickBan       = true;
             shouldNotifyPickSelection = true;
             actionId = Action.Id;
         }
         if (Action.IsInProgress)
         {
             SessionActionType type = Action.Type;
             if ((shouldNotifyPickBan && type == SessionActionType.Ban) || (shouldNotifyPickSelection && type == SessionActionType.Pick))
             {
                 leagueAPI.logger.Verbose("Invoked OnChampSelectTurnToPick with type: " + type);
                 OnChampSelectTurnToPick?.Invoke(s, type);
             }
             if (Action.Type == SessionActionType.Pick)
             {
                 shouldNotifyPickSelection = false;
             }
             if (Action.Type == SessionActionType.Ban)
             {
                 shouldNotifyPickBan = false;
             }
         }
     }
     catch
     {
         leagueAPI.logger.Error("");
     }
 }
示例#2
0
 private static void Events_OnChampSelectTurnToPick(object sender, SessionActionType e)
 {
 }