public void RMPlayer(string account)
        {
            Gtk.Application.Invoke(delegate
            {
                Common.Players.GraalPlayer player = this.Server.FindPlayer(account);

                /*
                 * TreeNode[] player2 = this.Players.Nodes.Find(account,true);
                 * TreeNode[] rc = this.RCs.Nodes.Find(account,true);
                 *
                 * if (player2.Length == 0)
                 * {
                 *      // Do nothing
                 * }
                 * else
                 * {
                 *      player2[0].Remove();
                 * }
                 *
                 * if (rc.Length == 0)
                 * {
                 *      // Do nothing
                 * }
                 * else
                 * {
                 *      rc[0].Remove();
                 * }
                 */
            }
                                   );
        }
Ejemplo n.º 2
0
        public void WindowInit()
        {
            this.Icon            = global::Gdk.Pixbuf.LoadFromResource("OpenGraal.GraalIM.Resources.rcicon.ico");
            this.Server          = Framework.GetInstance();
            this.PMWindowManager = PMWindowList.GetInstance();

            this.PMPlayer = this.Server.FindPlayer(this.Id);
            string TitleText = "";

            if (this.PMPlayer != null)
            {
                TitleText = this.PMPlayer.Account;
                if (this.PMPlayer.Nickname != "" && this.PMPlayer.Nickname != null)
                {
                    TitleText += ": " + this.PMPlayer.Nickname;
                }
            }
            this.Title = TitleText;
            this.Show();
        }
        private void SendPM(string[] command)
        {
            Common.Players.GraalPlayer PMPlayer = Framework.FindPlayer(command[1].Trim());

            PMWindowManager = PMWindowList.GetInstance();
            PMWindow PM = PMWindowManager.AddPMWindow(PMPlayer.Id);

            String msg = "";

            for (int i = 2; i < command.Length; i++)
            {
                msg += command[i].Trim() + " ";
            }

            // Turn the string into a CString.
            Core.CString Message = new Core.CString(msg);

            if (PM != null)
            {
                PM.SendMessage(Message);
            }
        }
        public void AddPlayer(string account, string nickname)
        {
            this.Framework = Framework.GetInstance();

            nickname = (nickname != null) ? nickname : "unknown";
            if (account != null)
            {
                Gtk.Application.Invoke(delegate
                {
                    Common.Players.GraalPlayer player = this.Framework.FindPlayer(account);

                    /*
                     * if (player != null && player.Account != null)
                     * {
                     *
                     *      TreeNode[] player2 = this.Players.Nodes.Find(account, true);
                     *      TreeNode[] rc = this.RCs.Nodes.Find(account, true);
                     *      TreeNode[] irc = this.IRC.Nodes.Find(account, true);
                     *      if (player.Account.StartsWith("irc:"))
                     *      {
                     *              if (irc.Length == 0)
                     *              {
                     *                      if (player.Account != null && player.Level != null && player.Nickname != null)
                     *                              this.IRC.Nodes.Add(player.Account.ToString(), player.Nickname.ToString());
                     *                      else if (player.Account != null && player.Level != null && player.Nickname == "")
                     *                              this.RCs.Nodes.Add(player.Account.ToString(), player.Account.Split(':')[1].ToString());
                     *              }
                     *              else
                     *              {
                     *                      irc[0].Text = player.Nickname;
                     *              }
                     *      }
                     *      else
                     *      {
                     *
                     *              if (player2.Length == 0)
                     *              {
                     *                      if (player.Account != null && player.Level != null && player.Nickname != null)
                     *                              this.Players.Nodes.Add(player.Account.ToString(), player.Nickname);
                     *                      else if (player.Account != null)
                     *                              this.Players.Nodes.Add(player.Account.ToString(), "*" + player.Account.ToString());
                     *              }
                     *              else
                     *              {
                     *                      player2[0].Text = player.Nickname;
                     *              }
                     *
                     *              if (rc.Length == 0)
                     *              {
                     *                      if (player.Account != null && player.Level != null && player.Nickname != null)
                     *                              this.RCs.Nodes.Add(player.Account.ToString(), player.Nickname.ToString());
                     *                      else if (player.Account != null && player.Level != null && player.Nickname == "")
                     *                              this.RCs.Nodes.Add(player.Account.ToString(), "*" + player.Account.ToString());
                     *              }
                     *              else
                     *              {
                     *                      rc[0].Text = player.Nickname;
                     *              }
                     *      }
                     * }
                     */
                }
                                       );
            }
        }