Exemple #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);
        }
Exemple #2
0
 public void RemoveHandler(object sender, ReceivedChannelModeEventArgs e)
 {
     if (!e.Channel.ClearFlag(Flag))
     {
         e.Cancel();
     }
 }
Exemple #3
0
 public void AddHandler(object sender, ReceivedChannelModeEventArgs e)
 {
     if (!e.Channel.SetFlag(Flag))
     {
         e.Cancel();
     }
 }
Exemple #4
0
 public void RemoveHandler(object sender, ReceivedChannelModeEventArgs e)
 {
     if (!e.Channel.Properties.Remove(Key))
     {
         e.Cancel();
     }
 }
Exemple #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();
            }
        }
Exemple #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);
        }
Exemple #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();
            }
        }