public void Initialize(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 ["UniverseChat"].GetInt("whisper_distance", m_whisperdistance); m_saydistance = config.Configs ["UniverseChat"].GetInt("say_distance", m_saydistance); m_shoutdistance = config.Configs ["UniverseChat"].GetInt("shout_distance", m_shoutdistance); maxlisteners = config.Configs ["UniverseChat"].GetInt("max_listens_per_region", maxlisteners); maxhandles = config.Configs ["UniverseChat"].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); }
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["UniverseChat"].GetInt("whisper_distance", m_whisperdistance); m_saydistance = config.Configs["UniverseChat"].GetInt("say_distance", m_saydistance); m_shoutdistance = config.Configs["UniverseChat"].GetInt("shout_distance", m_shoutdistance); maxlisteners = config.Configs["UniverseChat"].GetInt("max_listens_per_region", maxlisteners); maxhandles = config.Configs["UniverseChat"].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); }