コード例 #1
0
		internal PMWindow(Int16 Id)
		{
			this.Server = Framework.GetInstance();
			this.form = MainWindow2.GetInstance();
			this.Id = Id;
			this.PMPlayer = (GraalPlayer)this.Server.PlayerManager.FindPlayer(this.Id);
			this.CenterToScreen();
			
			string TitleText = "";
			TitleText = this.PMPlayer.Account;
			if (this.PMPlayer.Nickname != "" && this.PMPlayer.Nickname != null)
				TitleText +=  ": " + this.PMPlayer.Nickname;
			this.Text = TitleText;
			this.InitializeComponent(Id);
			this.richTextBox1.ReadOnly = true;
			//this.listBox1 = listBox1;

			//e.
			/*
			try
			{
				this.InitializeComponent();
				this.Show();
			}
			catch (SyntaxErrorException e)
			{
				this.form.Write_Text(e.Message + "\r\n");
			}
			*/
		}
コード例 #2
0
        /// <summary>
        /// Add Player to Playerlist (or return player)
        /// </summary>
        public virtual GraalPlayer AddPlayer(Int16 Id, CSocket socket)
        {
            GraalPlayer pl = FindPlayer(Id);
            if (pl == null)
            {
                GraalPlayer Player = new GraalPlayer(Id, socket);
                PlayerList[Id] = Player;
                return Player;
            }

            return pl;
        }
コード例 #3
0
		public void ReceivedPM(GraalPlayer Player, CString Message)
		{
			this.form = Abstraction.GetInstance();

			if (Player != null)
			{
				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);
				}
			}
			else
				this.form.WriteText("Something went wrong. Player is null.");
		}
コード例 #4
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();
		}
コード例 #5
0
		public void ReceivedToall(GraalPlayer Player, CString Message)
		{
			this.form = Abstraction.GetInstance();

			ToallsWindow PM = ToallsWindow.GetInstance();

			if (PM != null)
			{
				PM.SetMessage(Player, Message);
			}
		}
コード例 #6
0
		/// <summary>
		/// Delete Player from Level
		/// </summary>
		/// <param name="Player"></param>
		public void DeletePlayer(GraalPlayer Player)
		{
			if (Players.Contains(Player))
			{
				Player.CallNPCs("onPlayerLeaves", new object[] { Player });
				Players.Remove(Player);
				
				this.CallNPCs("onPlayerLeaves", new object[] { Player });
			}
		}
コード例 #7
0
		/// <summary>
		/// Add Player to Level
		/// </summary>
		/// <param name="Player"></param>
		public void AddPlayer(GraalPlayer Player)
		{
			if (!Players.Contains(Player) && Player != null)
			{
				Players.Add(Player);
				try
				{
					Player.Level = this;
					this.CallNPCs("onPlayerEnters", new object[] { Player });
					Player.CallNPCs("onPlayerEnters", new object[] { Player });
				}
				catch (System.NullReferenceException e)
				{
					Console.WriteLine("error: " + e.Message);
				}
				
			}
		}
コード例 #8
0
 /// <summary>
 /// Library Function -> Trigger Event
 /// </summary>
 public void trigger(GraalPlayer player, string Event, string[] args)
 {
     this.Call(Event, new object[] { player, args });
 }
コード例 #9
0
 /// <summary>
 /// Attach Player to Object
 /// </summary>
 public void detachplayer(GraalPlayer player)
 {
     if (player != null && Ref.npcserver)
         this.SendGSPacket(new CString() + (byte)OpenGraal.Common.Levels.GraalLevelNPC.PacketOut.NCQUERY + (byte)OpenGraal.Common.Levels.GraalLevelNPC.NCREQ.PLSETPROPS + (short)player.Id + (byte)GraalPlayer.Properties.PLATTACHNPC + (byte)0 + (int)0);
 }