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