Пример #1
0
        public void AddHandler(object sender, ReceivedChannelModeEventArgs e)
        {
            List <HostMask> list = GetList(e.Channel);

            if (list.Count > e.Server.Settings.MaximumListSize &&
                (!e.Channel.HasFlag("LongLists") ||
                 list.Count > e.Server.Settings.MaximumLongListSize))
            {
                e.User.SendNumeric(Numerics.ERR_BANLISTFULL, "That list is full.  Contact a network operator to override this.");
                e.Cancel();
                return;
            }

            HostMask mask = HostMask.Parse(e.Argument);

            if ((mask.Nickname == null || mask.Username == null || mask.Hostname == null) && mask.Account == null)
            {
                e.User.SendNumeric(Numerics.ERR_BADMASK, "List entries must be fully qualified hostmasks.");
                e.Cancel();
                return;
            }

            if (list.Contains(mask))
            {
                e.Cancel();
                return;
            }

            list.Add(mask);
        }
Пример #2
0
 public void RemoveHandler(object sender, ReceivedChannelModeEventArgs e)
 {
     if (!e.Channel.ClearFlag(Flag))
     {
         e.Cancel();
     }
 }
Пример #3
0
 public void AddHandler(object sender, ReceivedChannelModeEventArgs e)
 {
     if (!e.Channel.SetFlag(Flag))
     {
         e.Cancel();
     }
 }
Пример #4
0
 public void RemoveHandler(object sender, ReceivedChannelModeEventArgs e)
 {
     if (!e.Channel.Properties.Remove(Key))
     {
         e.Cancel();
     }
 }
Пример #5
0
        public void RemoveHandler(object sender, ReceivedChannelModeEventArgs e)
        {
            List <HostMask> list = GetList(e.Channel);
            HostMask        mask = HostMask.Parse(e.Argument);

            if (!list.Remove(mask))
            {
                e.Cancel();
            }
        }
Пример #6
0
        public void RemoveHandler(object sender, ReceivedChannelModeEventArgs e)
        {
            UserBase target = e.Channel.GetUser(e.Argument, e.User);

            if (target == null)
            {
                e.Cancel();
                return;
            }

            e.Channel.RemovePrefix(target, Prefix);
        }
Пример #7
0
        public void AddHandler(object sender, ReceivedChannelModeEventArgs e)
        {
            ChannelBase channel = e.Server.GetChannel(e.Argument);

            if (channel != null && (e.User.IsProtect(channel) || channel.HasFlag("FreeTarget")))
            {
                e.Channel.Properties[this.GetType().Name] = e.Argument;
            }
            else
            {
                e.User.SendNumeric(Numerics.ERR_RESTRICTED, "MODE", ":You must be +a in the target channel in order to forward to it, unless it is a free target.");
                e.Cancel();
            }
        }