Ejemplo n.º 1
0
        public void Initialise(IConfigSource config)
        {
            // wrap this in a try block so that defaults will work if
            // the config file doesn't specify otherwise.
            int maxlisteners = 1000;
            int maxhandles   = 64;

            try
            {
                m_whisperdistance = config.Configs["AuroraChat"].GetInt("whisper_distance", m_whisperdistance);
                m_saydistance     = config.Configs["AuroraChat"].GetInt("say_distance", m_saydistance);
                m_shoutdistance   = config.Configs["AuroraChat"].GetInt("shout_distance", m_shoutdistance);
                maxlisteners      = config.Configs["AuroraChat"].GetInt("max_listens_per_region", maxlisteners);
                maxhandles        = config.Configs["AuroraChat"].GetInt("max_listens_per_script", maxhandles);
            }
            catch (Exception)
            {
            }
            if (maxlisteners < 1)
            {
                maxlisteners = int.MaxValue;
            }
            if (maxhandles < 1)
            {
                maxhandles = int.MaxValue;
            }
            m_listenerManager = new ListenerManager(maxlisteners, maxhandles);
            m_pendingQ        = new Queue();
            m_pending         = Queue.Synchronized(m_pendingQ);
        }
Ejemplo n.º 2
0
 public void Initialise(IConfigSource config)
 {
     // wrap this in a try block so that defaults will work if
     // the config file doesn't specify otherwise.
     int maxlisteners = 1000;
     int maxhandles = 64;
     try
     {
         m_whisperdistance = config.Configs["AuroraChat"].GetInt("whisper_distance", m_whisperdistance);
         m_saydistance = config.Configs["AuroraChat"].GetInt("say_distance", m_saydistance);
         m_shoutdistance = config.Configs["AuroraChat"].GetInt("shout_distance", m_shoutdistance);
         maxlisteners = config.Configs["AuroraChat"].GetInt("max_listens_per_region", maxlisteners);
         maxhandles = config.Configs["AuroraChat"].GetInt("max_listens_per_script", maxhandles);
     }
     catch (Exception)
     {
     }
     if (maxlisteners < 1) maxlisteners = int.MaxValue;
     if (maxhandles < 1) maxhandles = int.MaxValue;
     m_listenerManager = new ListenerManager(maxlisteners, maxhandles);
     m_pendingQ = new Queue();
     m_pending = Queue.Synchronized(m_pendingQ);
 }