Ejemplo n.º 1
0
        /// <summary>
        /// Add Player to Playerlist (or return player)
        /// </summary>
        public Player AddPlayer(Int16 Id)
        {
            Player pl = this.FindPlayer(Id);
            if (pl == null)
            {
                Player Player = new Player(Id);
                PlayerList[Id] = Player;
                //PlayerList2.Add(Player);
                return Player;
            }

            return pl;
        }
Ejemplo n.º 2
0
        public void ReceivedPM(Player Player, CString Message)
        {
            this.form = Abstraction.GetInstance();
            this.form.WriteText(" -!- Received PM from " + Player.Account.ToString() + "!\n");

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

            if (PM != null)
            {
                PM.SetMessage(Message);
            }
        }
Ejemplo n.º 3
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 = (Player)this.Server.PlayerManager.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 ReceiveToall(Player Player, CString Message)
        {
            this.form = Abstraction.GetInstance();
            //this.form.WriteText(" -!- Received toall from " + Player.Account.ToString() + "!\n");

            ToallsWindow PM = ToallsWindow.GetInstance();

            if (PM != null)
            {
                PM.SetMessage(Player, Message);
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Find Player by Account
 /// </summary>
 public Player FindPlayer(String Account)
 {
     Player rc = new Player(0);
     try
     {
         foreach (KeyValuePair<Int16, Player> Player in PlayerList)
         {
             if (Account != null && Player.Value.Account != null)
             {
                 if (Player.Value.Account.ToLower() == Account.ToLower())
                 {
                     if (Player.Value.Level != null && Player.Value.isLocalPlayer == true)
                         return Player.Value;
                     else
                         rc = Player.Value;
                 }
             }
         }
     }
     catch (Exception e)
     {
         return null;
     }
     finally
     {
     }
     return rc;
 }
Ejemplo n.º 6
0
        public void ReceivedToall(Player Player, CString Message)
        {
            this.form = Abstraction.GetInstance();

            ToallsWindow PM = ToallsWindow.GetInstance();

            if (PM != null)
            {
                PM.SetMessage(Player, Message);
            }
        }