Exemple #1
0
        private bool OnInvitePrivelages(InvitePrivileges privelage)
        {
            state.CanInvite = privelage.CanInvite;

            OnStateChanged();
            return(true);
        }
 private void Update_OnMessageReceived(object sender, object message)
 {
     if (message.GetType() == typeof(LobbyStatus))
     {
         LobbyStatus Lobby = message as LobbyStatus;
         CurrentLobby = Lobby;
         RenderLobbyData();
     }
     else if (message is GameDTO)
     {
         GameDTO QueueDTO = message as GameDTO;
         Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
         {
             if (QueueDTO.GameState == "TERMINATED")
             {
                 Client.OverlayContainer.Visibility = Visibility.Hidden;
                 Client.OverlayContainer.Content    = null;
                 if (QueueDTO.QueuePosition == 0) //They changed this as soon as I fixed it. Damnit riot lol.
                 {
                     setStartButtonText("Start Game");
                     inQueue = false;
                     Client.PVPNet.PurgeFromQueues();
                 }
                 else
                 {
                     Client.PVPNet.OnMessageReceived += GotQueuePop;
                 }
             }
         }));
     }
     else if (message is GameNotification)
     {
         Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
         {
             setStartButtonText("Start Game");
             inQueue = false;
         }));
     }
     else if (message is SearchingForMatchNotification)
     {
         Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
         {
             EnteredQueue(message as SearchingForMatchNotification);
         }));
     }
     else if (message is InvitePrivileges)
     {
         Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
         {
             InvitePrivileges priv = message as InvitePrivileges;
             if (priv.canInvite)
             {
                 TextRange tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
                 tr.Text      = "You may invite players to this game." + Environment.NewLine;
                 tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Yellow);
                 InviteButton.IsEnabled = true;
             }
             else
             {
                 TextRange tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
                 tr.Text      = "You may no longer invite players to this game." + Environment.NewLine;
                 tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Yellow);
                 InviteButton.IsEnabled = false;
             }
         }));
     }
     else if (message is LcdsServiceProxyResponse)
     {
         parseLcdsMessage(message as LcdsServiceProxyResponse); //Don't look there, its ugly!!! :)))
     }
 }