示例#1
0
        void XmppConnection_OnMessage(object sender, Message msg)
        {
            if (jid.Bare.Contains(msg.From.User))
            {
                return;
            }

            if (msg.From.Resource == Client.LoginPacket.AllSummonerData.Summoner.Name)
            {
                return;
            }

            Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
            {
                if (msg.Body != "This room is not anonymous")
                {
                    var tr  = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
                    tr.Text = msg.From.Resource + ": ";
                    tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Turquoise);
                    tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
                    if (Client.Filter)
                    {
                        tr.Text = msg.Body.Replace("<![CDATA[", "").Replace("]]>", "").Filter() +
                                  Environment.NewLine;
                    }
                    else
                    {
                        tr.Text = msg.Body.Replace("<![CDATA[", "").Replace("]]>", "") + Environment.NewLine;
                    }
                    tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.White);
                    ChatText.ScrollToEnd();
                }
            }));
        }
        private void newRoom_OnRoomMessage(object sender, Message msg)
        {
            Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
            {
                if (msg.Body == "This room is not anonymous")
                {
                    return;
                }

                var tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd)
                {
                    Text = msg.From.Resource + ": "
                };
                tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Blue);
                tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
                if (Client.Filter)
                {
                    tr.Text = msg.InnerText.Replace("<![CDATA[", "").Replace("]]>", "").Filter() +
                              Environment.NewLine;
                }
                else
                {
                    tr.Text = msg.InnerText.Replace("<![CDATA[", "").Replace("]]>", "") + Environment.NewLine;
                }

                tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.White);

                ChatText.ScrollToEnd();
            }));
        }
        private void ChatButton_Click(object sender, RoutedEventArgs e)
        {
            var tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd)
            {
                Text = Client.LoginPacket.AllSummonerData.Summoner.Name + ": "
            };

            tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Yellow);
            tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
            if (Client.Filter)
            {
                tr.Text = ChatTextBox.Text.Filter() + Environment.NewLine;
            }
            else
            {
                tr.Text = ChatTextBox.Text + Environment.NewLine;
            }

            tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.White);
            if (String.IsNullOrEmpty(ChatTextBox.Text))
            {
                return;
            }

            _newRoom.PublicMessage(ChatTextBox.Text);
            ChatTextBox.Text = "";
            ChatText.ScrollToEnd();
        }
示例#4
0
 private void newRoom_OnParticipantJoin(Room room, RoomParticipant participant)
 {
     Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
     {
         TextRange tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
         tr.Text      = participant.Nick + " joined the room." + Environment.NewLine;
         tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Yellow);
         ChatText.ScrollToEnd();
     }));
 }
示例#5
0
        void XmppConnection_OnPresence(object sender, Presence pres)
        {
            if (pres.To.Bare != jid.Bare)
            {
                return;
            }

            Dispatcher.BeginInvoke(DispatcherPriority.Input, new ThreadStart(() =>
            {
                var tr  = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
                tr.Text = pres.From.Resource + " joined the room." + Environment.NewLine;
                tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Yellow);
                ChatText.ScrollToEnd();
            }));
        }
 private void ChatButton_Click(object sender, RoutedEventArgs e)
 {
     if (ChatTextBox.Text == "!~dev")
     {
         DevMode = !DevMode;
         TextRange tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
         tr.Text = "DEV MODE: " + DevMode + Environment.NewLine;
         tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Yellow);
         ChatTextBox.Text = "";
         if (DevMode)
         {
             CreateRankedCheckBox.Visibility = Visibility.Visible; SelectChampBox.Visibility = Visibility.Visible;
         }
         else
         {
             CreateRankedCheckBox.Visibility = Visibility.Hidden; SelectChampBox.Visibility = Visibility.Hidden;
         }
     }
     else
     {
         TextRange tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
         tr.Text = Client.LoginPacket.AllSummonerData.Summoner.Name + ": ";
         tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Yellow);
         tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
         if (Client.Filter)
         {
             tr.Text = ChatTextBox.Text.Filter() + Environment.NewLine;
         }
         else
         {
             tr.Text = ChatTextBox.Text + Environment.NewLine;
         }
         tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.White);
         if (String.IsNullOrEmpty(ChatTextBox.Text))
         {
             return;
         }
         newRoom.PublicMessage(ChatTextBox.Text);
         ChatTextBox.Text = "";
         ChatText.ScrollToEnd();
     }
 }
示例#7
0
 private void ChatButton_Click(object sender, RoutedEventArgs e)
 {
     if (ChatTextBox.Text == "!~dev")
     {
         if (!Client.Dev)
         {
             var tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
             tr.Text = "You are not a dev." + Environment.NewLine;
             tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Yellow);
         }
         ChatTextBox.Text = "";
     }
     else
     {
         var tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
         tr.Text = Client.LoginPacket.AllSummonerData.Summoner.Name + ": ";
         tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Yellow);
         tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
         if (Client.Filter)
         {
             tr.Text = ChatTextBox.Text.Filter() + Environment.NewLine;
         }
         else
         {
             tr.Text = ChatTextBox.Text + Environment.NewLine;
         }
         tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.White);
         if (string.IsNullOrEmpty(ChatTextBox.Text))
         {
             return;
         }
         Client.XmppConnection.Send(new Message(jid, MessageType.groupchat, ChatTextBox.Text));
         ChatTextBox.Text = "";
         ChatText.ScrollToEnd();
     }
 }
        private void ChatButton_Click(object sender, RoutedEventArgs e)
        {
            if (ChatTextBox.Text == "!~dev")
            {
                #region Authenticate
                Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
                dlg.DefaultExt = ".png";
                dlg.Filter     = "Key Files (*.key)|*.key|Sha1 Key Files(*.Sha1Key)|*Sha1Key";
                if ((bool)dlg.ShowDialog())
                {
                    string filecontent = File.ReadAllText(dlg.FileName).ToSHA1();
                    using (WebClient client = new WebClient())
                    {
                        //Nope. You do not have the key file still shows the maked ranked so boosters learn the hard way
                        if (client.DownloadString("http://eddy5641.github.io/LegendaryClient/Data.sha1").Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None)[0] == filecontent)
                        {
                            rankedQueue = 4;

                            MessageBox.Show("Ranked Hack Enabled",
                                            "LC Notification.",
                                            MessageBoxButton.OK,
                                            MessageBoxImage.Information);
                        }
                        else
                        {
                            MessageBox.Show("Ranked Hack Enabled",
                                            "LC Notification",
                                            MessageBoxButton.OK,
                                            MessageBoxImage.Information);
                        }
                    }
                }
                #endregion

                DevMode = !DevMode;
                var tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
                tr.Text = "DEV MODE: " + DevMode + Environment.NewLine;
                tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Yellow);
                ChatTextBox.Text = "";
                if (DevMode)
                {
#if DEBUG
                    CreateRankedCheckBox.Visibility = Visibility.Visible;
#endif
                    SelectChamp.Visibility = Visibility.Visible;
                }
                else
                {
                    CreateRankedCheckBox.Visibility = Visibility.Hidden;
                    SelectChamp.Visibility          = Visibility.Hidden;
                }
            }
            else
            {
                var tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
                tr.Text = Client.LoginPacket.AllSummonerData.Summoner.Name + ": ";
                tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Yellow);
                tr = new TextRange(ChatText.Document.ContentEnd, ChatText.Document.ContentEnd);
                if (Client.Filter)
                {
                    tr.Text = ChatTextBox.Text.Filter() + Environment.NewLine;
                }
                else
                {
                    tr.Text = ChatTextBox.Text + Environment.NewLine;
                }
                tr.ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.White);
                if (String.IsNullOrEmpty(ChatTextBox.Text))
                {
                    return;
                }
                newRoom.PublicMessage(ChatTextBox.Text);
                ChatTextBox.Text = "";
                ChatText.ScrollToEnd();
            }
        }