Ejemplo n.º 1
0
 public static Queue Create(SearchingForMatchNotification searching) {
   if (searching.PlayerJoinFailures != null) {
     var leaver = searching.PlayerJoinFailures[0];
     bool me = leaver.Summoner.SummonerId == Session.Current.Account.SummonerID;
     switch (leaver.ReasonFailed) {
       case "LEAVER_BUSTER":
         throw new Exception("Leaver Buster");
       //TODO Leaverbuster
       case "QUEUE_DODGER":
         throw new Exception("Queue Dodger");
       //TODO Queue delay event
       default:
         throw new Exception(leaver.ReasonFailed);
     }
   } else if (searching.JoinedQueues != null && searching.JoinedQueues.Count > 0) {
     if (searching.JoinedQueues.Count != 1)
       Session.Log("Received incorrect number of joined queues");
     return new Queue(searching.JoinedQueues.FirstOrDefault());
   } else throw new Exception("Unknown exception");
 }
Ejemplo n.º 2
0
 protected virtual void OnQueueEntered(SearchingForMatchNotification searching) {
   try {
     queue = Queue.Create(searching);
     queue.QueueCancelled += (s, e) => OnQueueLeft();
     QueueEntered?.Invoke(this, new QueueEventArgs(queue));
   } catch (Exception x) {
     //TODO Queue Dodge and the like
     Session.ThrowException(x, "Trying to enter queue");
     Dispose();
   }
 }