예제 #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();
                var bytes = BanMgr.GetBytes(mask);

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

                var time   = trigger.Text.NextTimeSpan();
                var reason = trigger.Text.Remainder;

                var ban = BanMgr.AddBan(time, mask, reason);

                trigger.Reply("Added new Ban: " + ban);
            }