Пример #1
0
        /// <summary>
        /// Called when the channel ban list has been received
        /// </summary>
        public static void OnIrcEndOfBanList()
        {
            lock (State.GlobalSync)
            {
                if (state != BanSystemState.WaitingForChannel) throw new Exception("Unexpected state transition");

                if (Irc.QLevel >= QAuthLevel.Operator)
                {
                    state = BanSystemState.WaitingForQ;
                    QCommand command = new BanListCommand(0);
                    command.OnFinished += new QCommand.OnFinishedDelegate(OnQInitialBanList);
                }
                else
                {
                    Program.Log("Insufficient Q access privileges to run ban system");
                    state = BanSystemState.Error;
                }
            }
        }
Пример #2
0
 /// <summary>
 /// Called when the initial Q ban list command was received
 /// </summary>
 /// <param name="succeeded"></param>
 public static void OnQInitialBanList(bool succeeded)
 {
     lock (State.GlobalSync)
     {
         if (state != BanSystemState.WaitingForQ) throw new Exception("Unexpected state transition");
         state = BanSystemState.Synchronized;
         Program.Log("BanSystem entering ready state");
     }
 }
Пример #3
0
 /// <summary>
 /// Reset the ban system
 /// </summary>
 public static void Reset()
 {
     lock (State.GlobalSync)
     {
         state = BanSystemState.WaitingForChannel;
         extended = new Dictionary<string, ExtendedBanInfo>();
         refresh_pending = true;
         next_q_ban = null;
         next_q_unban = null;
         keep = null;
     }
 }