Exemplo n.º 1
0
 public SearchingForMatchNotification AttachToQueue(MatchMakerParams matchMakerParams, string token)
 {
     int Id = Invoke("matchmakerService", "attachToQueue", new object[] { matchMakerParams.GetBaseTypedObject(), token });
     while (!results.ContainsKey(Id))
         System.Threading.Thread.Sleep(10);
     TypedObject messageBody = results[Id].GetTO("data").GetTO("body");
     SearchingForMatchNotification result = new SearchingForMatchNotification(messageBody);
     results.Remove(Id);
     return result;
 }
Exemplo n.º 2
0
 public void AttachToQueue(MatchMakerParams matchMakerParams, string token, SearchingForMatchNotification.Callback callback)
 {
     SearchingForMatchNotification cb = new SearchingForMatchNotification(callback);
     InvokeWithCallback("matchmakerService", "attachToQueue",
         new object[] { matchMakerParams.GetBaseTypedObject(), token }, cb);
 }
        private void EnteredQueue(SearchingForMatchNotification result)
        {
            if (result.PlayerJoinFailures != null)
            {
                Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
                {
                    Button item = LastSender;
                    GameQueueConfig config = (GameQueueConfig)item.Tag;
                    Queues.Remove(config.Id);
                    MessageOverlay message = new MessageOverlay();
                    message.MessageTitle.Content = "Failed to join queue";
                    message.MessageTextBox.Text = result.PlayerJoinFailures[0].ReasonFailed;
                    if (result.PlayerJoinFailures[0].ReasonFailed == "QUEUE_DODGER")
                    {
                        message.MessageTextBox.Text = "Unable to join the queue due to you recently dodging a game." + Environment.NewLine;
                        TimeSpan time = TimeSpan.FromMilliseconds(result.PlayerJoinFailures[0].PenaltyRemainingTime);
                        message.MessageTextBox.Text = "You have " + string.Format("{0:D2}m:{1:D2}s", time.Minutes, time.Seconds) + " remaining until you may queue again";
                    }
                    else if (result.PlayerJoinFailures[0].ReasonFailed == "RANKED_MIN_LEVEL")
                    {
                        message.MessageTextBox.Text = "You do not meet the level requirements for this queue! Please wait until you are a higher level.";
                    }
                    Client.OverlayContainer.Content = message.Content;
                    Client.OverlayContainer.Visibility = Visibility.Visible;
                }));
                return;
            }

            Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
            {
                Button item = LastSender;
                Button fakeButton = new Button(); //We require a unique button to add to the dictionary
                fakeButton.Tag = item;
                item.Content = "00:00";
                ButtonTimers.Add(fakeButton, 0);
            }));
            Client.PVPNet.OnMessageReceived += GotQueuePop;
        }
Exemplo n.º 4
0
 private void EnteredQueue(SearchingForMatchNotification result)
 {
     if (result.PlayerJoinFailures != null)
     {
         Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
         {
             MessageOverlay messageOver = new MessageOverlay();
             messageOver.MessageTitle.Content = "Could not join the queue";
             foreach (QueueDodger x in result.PlayerJoinFailures)
             {
                 messageOver.MessageTextBox.Text += x.Summoner.Name + " is unable to join the queue as they recently dodged a game." + Environment.NewLine;
                 TimeSpan time = TimeSpan.FromMilliseconds(x.PenaltyRemainingTime);
                 messageOver.MessageTextBox.Text += "You have " + string.Format("{0:D2}m:{1:D2}s", time.Minutes, time.Seconds) + " remaining until you may queue again";
             }
             messageOver.Content = messageOver.Content;
             messageOver.Visibility = Visibility.Visible;
         }));
         return;
     }
 }
 public async Task<SearchingForMatchNotification> AttachToQueue(MatchMakerParams matchMakerParams, string accessToken)
 {
     TypedObject typedObject = new TypedObject(null);
     typedObject.Add("LEAVER_BUSTER_ACCESS_TOKEN", accessToken);
     int Id = Invoke("matchmakerService", "attachToQueue", new object[] { matchMakerParams.GetBaseTypedObject(), typedObject });
     while (!results.ContainsKey(Id))
         await Task.Delay(10);
     TypedObject messageBody = results[Id].GetTO("data").GetTO("body");
     SearchingForMatchNotification result = new SearchingForMatchNotification(messageBody);
     results.Remove(Id);
     return result;
 }
 public async Task<SearchingForMatchNotification> AttachTeamToQueue(MatchMakerParams matchMakerParams)
 {
     int Id = Invoke("matchmakerService", "attachTeamToQueue", new object[] { matchMakerParams.GetBaseTypedObject() });
     while (!results.ContainsKey(Id))
         await Task.Delay(10);
     TypedObject messageBody = results[Id].GetTO("data").GetTO("body");
     SearchingForMatchNotification result = new SearchingForMatchNotification(messageBody);
     results.Remove(Id);
     return result;
 }