Ejemplo n.º 1
0
        private void LoadData()
        {
            IniSection section = m_iniReader.GetSectionByName("stream");

            if (section == null)
            {
                throw new InvalidOperationException("Options file missing [Stream] section.");
            }

            m_stream     = section.GetValue("stream");
            m_twitchName = section.GetValue("twitchname") ?? section.GetValue("user") ?? section.GetValue("username");
            m_oauthPass  = section.GetValue("oauth") ?? section.GetValue("pass") ?? section.GetValue("password");
            section.GetValue("DataDirectory", ref m_dataDirectory);
            section.GetValue("passive", ref m_passive);

            // Set defaults

            m_regulars = true;

            section = m_iniReader.GetSectionByName("Regulars");
            if (section != null)
            {
                section.GetValue("Enabled", ref m_regulars);
            }

            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);
        }
Ejemplo n.º 2
0
        public AutoPoll(WinterBot bot)
        {
            m_options = bot.Options.AutoPollOptions;
            if (!m_options.Enabled)
            {
                return;
            }

            bot.MessageReceived += bot_MessageReceived;
            bot.Tick            += bot_Tick;
        }
Ejemplo n.º 3
0
        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);
        }