예제 #1
0
파일: Options.cs 프로젝트: hasaki/WinterBot
        public CapsTimeoutOptions(IniReader options)
        {
            var section = options.GetSectionByName("capstimeout");

            base.Init(section);
            if (section != null)
            {
                m_length.Init(section.GetValue, "MaxCaps");
                m_percent.Init(section.GetValue, "MaxCapsPercent");
                section.GetValue("Message", ref m_message);
            }
        }
예제 #2
0
파일: Options.cs 프로젝트: hasaki/WinterBot
        public BanWordOptions(IniReader options)
        {
            var section = options.GetSectionByName("bannedwords");

            if (section != null)
            {
                m_bannedWords = (from r in section.EnumerateRawStrings() where !string.IsNullOrWhiteSpace(r) select r).ToArray();
            }

            section = options.GetSectionByName("BanWords");

            if (section != null)
            {
                base.Init(section);
                section.GetValue("TimeoutDuration", ref m_timeoutDuration);
                section.GetValue("Message", ref m_message);
            }
        }
예제 #3
0
파일: Options.cs 프로젝트: hasaki/WinterBot
        public Options()
        {
            m_dataDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "WinterBot").Replace("\\\\", "\\");
            if (!Directory.Exists(m_dataDirectory))
            {
                Directory.CreateDirectory(m_dataDirectory);
            }

            m_iniReader          = new Winter.IniReader();
            m_urlOptions         = new UrlTimeoutOptions(m_iniReader);
            m_capsOptions        = new CapsTimeoutOptions(m_iniReader);
            m_lengthOptions      = new LengthTimeoutOptions(m_iniReader);
            m_symbolOptions      = new SymbolTimeoutOptions(m_iniReader);
            m_emoteOptions       = new EmoteTimeoutOptions(m_iniReader);
            m_chatOptions        = new ChatOptions(m_iniReader);
            m_autoMessageOptions = new AutoMessageOptions(m_iniReader);
            m_banWordOptions     = new BanWordOptions(m_iniReader);
            m_autoPollOptions    = new AutoPollOptions(m_iniReader);
        }
예제 #4
0
파일: Options.cs 프로젝트: hasaki/WinterBot
        public ChatOptions(IniReader options)
        {
            var messages = options.GetSectionByName("messages");

            var chat = options.GetSectionByName("chat");

            if (chat != null)
            {
                chat.GetValue("SubscribeMessage", ref m_subMessage);
                chat.GetValue("FollowMessage", ref m_followMessage);
                chat.GetValue("SaveLog", ref m_saveLog);
                chat.GetValue("UserCommands", ref m_userCommands);
                chat.GetValue("UserCommandDelay", ref m_userCommandDelay);
                chat.GetValue("TimeoutFakeSubs", ref m_timeoutFakeSubs);
                chat.GetValue("FakeSubMessage", ref m_fakeSubMessage);

                m_neverTimeout.Init(chat.GetValue, "NeverTimeout", "NeverTimeoutRegulars", "NeverTimeoutSubscribers");
            }
        }
예제 #5
0
파일: Options.cs 프로젝트: hasaki/WinterBot
        public AutoPollOptions(IniReader reader)
        {
            var section = reader.GetSectionByName("autopoll");

            if (section != null)
            {
                section.GetValue("Enabled", ref m_enabled);
                section.GetValue("MaxValue", ref m_maxValue);
                section.GetValue("SubVoteCount", ref m_subVoteCount);
                section.GetValue("ReportTime", ref m_reportTime);
                section.GetValue("VoteTimeout", ref m_voteTimeout);
                section.GetValue("VoteThreshold", ref m_voteThreshold);
                section.GetValue("VoteClearTime", ref m_voteClearTimer);
            }

            if (m_maxValue < 2)
            {
                m_maxValue = 2;
            }
            else if (m_maxValue > 9)
            {
                m_maxValue = 9;
            }

            if (m_subVoteCount <= 0)
            {
                m_subVoteCount = 1;
            }

            if (m_reportTime < 10)
            {
                m_reportTime = 10;
            }

            if (m_voteTimeout <= m_reportTime)
            {
                m_voteTimeout = m_reportTime + 1;
            }
        }