Пример #1
0
            public override void Process(CmdTrigger <AuthServerCmdArgs> trigger)
            {
                var mask  = trigger.Text.NextWord();
                var bytes = BanMgr.GetBytes(mask);

                if (BanMgr.IsInvalid(bytes))
                {
                    trigger.Reply("Invalid Mask: " + mask);
                    return;
                }

                var bans = BanMgr.GetBanList(mask);

                if (bans.Count > 0)
                {
                    foreach (var ban in bans)
                    {
                        ban.DeleteAndFlush();
                    }
                    trigger.Reply("Deleted {0} matching Ban(s): " + bans.ToString(", "), bans.Count);
                }
                else
                {
                    trigger.Reply("No BanEntries found matching Mask: " + mask);
                }
            }
Пример #2
0
            public override void Process(CmdTrigger <AuthServerCmdArgs> trigger)
            {
                var mask = trigger.Text.NextWord();
                ICollection <BanEntry> bans;

                if (mask.Length > 0)
                {
                    bans = BanMgr.GetBanList(mask);
                }
                else
                {
                    bans = BanMgr.AllBans;
                }

                trigger.Reply("Found {0} {1}{2}",
                              bans.Count, bans.Count == 1 ? "Entry" : "Entries", bans.Count > 0 ? ":" : ".");

                var i = 0;

                foreach (var ban in bans)
                {
                    i++;
                    trigger.Reply("{0}. {1}", i, ban);
                }
            }