Exemplo n.º 1
0
        public virtual bool Message(PlayerMobile user, string text, bool message = true)
        {
            if (!CanMessage(user, text, message))
            {
                return(false);
            }

            if (!IsUser(user))
            {
                Join(user, message);
            }

            var msg = new WorldChatMessage(user, text, user.ToMapPoint(), DateTime.Now);

            var formatted = FormatMessage(user, text);

            Users.Keys.Where(u => CanSee(u, msg)).ForEach(u => MessageTo(user, u, formatted));

            if (WorldChat.CMOptions.HistoryBuffer > 0)
            {
                while (HistoryCount >= WorldChat.CMOptions.HistoryBuffer)
                {
                    History.Pop();
                }

                History.Add(user, msg);
            }
            else
            {
                History.Clear();
            }

            Users[user] = DateTime.Now + SpamDelay;

            OnMessage(user, msg, message);
            return(true);
        }
Exemplo n.º 2
0
		public override bool CanSee(PlayerMobile user, WorldChatMessage message)
		{
			return base.CanSee(user, message) && user.Region != null && user.Region.IsPartOf(typeof(TownRegion));
		}
Exemplo n.º 3
0
		public override bool CanSee(PlayerMobile user, WorldChatMessage message)
		{
			return base.CanSee(user, message) && user.Map == message.Place.Map;
		}
Exemplo n.º 4
0
 public override bool CanSee(PlayerMobile user, WorldChatMessage message)
 {
     return(base.CanSee(user, message) && user.Map == message.Place.Map);
 }
Exemplo n.º 5
0
		private static void InvokeUserMessage(WorldChatChannel channel, PlayerMobile user, WorldChatMessage message)
		{
			if (OnUserMessage != null)
			{
				OnUserMessage(channel, user, message);
			}
		}
Exemplo n.º 6
0
		protected virtual void OnMessage(PlayerMobile user, WorldChatMessage text, bool message = true)
		{
			InvokeUserMessage(this, user, text);
		}
Exemplo n.º 7
0
		public virtual bool Message(PlayerMobile user, string text, bool message = true)
		{
			if (!CanMessage(user, text, message))
			{
				return false;
			}

			if (!IsUser(user))
			{
				Join(user, message);
			}

			var msg = new WorldChatMessage(user, text, user.ToMapPoint(), DateTime.Now);

			string formatted = FormatMessage(user, text);

			Users.Keys.Where(u => CanSee(u, msg)).ForEach(u => MessageTo(user, u, formatted));

			if (WorldChat.CMOptions.HistoryBuffer > 0)
			{
				while (HistoryCount >= WorldChat.CMOptions.HistoryBuffer)
				{
					History.Pop();
				}

				History.Add(user, msg);
			}
			else
			{
				History.Clear();
			}

			Users[user] = DateTime.Now + SpamDelay;

			OnMessage(user, msg, message);
			return true;
		}
Exemplo n.º 8
0
		public virtual bool CanSee(PlayerMobile user, WorldChatMessage message)
		{
			return user != null && (user == message.User || (IsUser(user) && !IsBanned(user)));
		}
Exemplo n.º 9
0
 public override bool CanSee(PlayerMobile user, WorldChatMessage message)
 {
     return(base.CanSee(user, message) && user.Map == message.Place.Map && user.Region != null &&
            user.Region.Contains(message.Place.Location));
 }
Exemplo n.º 10
0
 protected virtual void OnMessage(PlayerMobile user, WorldChatMessage text, bool message = true)
 {
     InvokeUserMessage(this, user, text);
 }
Exemplo n.º 11
0
 public virtual bool CanSee(PlayerMobile user, WorldChatMessage message)
 {
     return(user != null && (user == message.User || (IsUser(user) && !IsBanned(user))));
 }
Exemplo n.º 12
0
 private static void InvokeUserMessage(WorldChatChannel channel, PlayerMobile user, WorldChatMessage message)
 {
     if (OnUserMessage != null)
     {
         OnUserMessage(channel, user, message);
     }
 }
Exemplo n.º 13
0
		public override bool CanSee(PlayerMobile user, WorldChatMessage message)
		{
			return base.CanSee(user, message) && user.Map == message.Place.Map && user.Region != null &&
				   user.Region.Contains(message.Place.Location);
		}
Exemplo n.º 14
0
 public override bool CanSee(PlayerMobile user, WorldChatMessage message)
 {
     return(base.CanSee(user, message) && user.Region != null && user.Region.IsPartOf(typeof(TownRegion)));
 }