Added a sanity check before using m_config in the Scene constructor

soprefactor
John Hurliman 2010-05-21 14:17:03 -07:00
parent abd5d1f747
commit d0eecf0398
1 changed files with 19 additions and 16 deletions

View File

@ -794,25 +794,28 @@ namespace OpenSim.Region.Framework.Scenes
#region Interest Management #region Interest Management
IConfig interestConfig = m_config.Configs["InterestManagement"]; if (m_config != null)
if (interestConfig != null)
{ {
string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower(); IConfig interestConfig = m_config.Configs["InterestManagement"];
if (interestConfig != null)
try
{ {
m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true); string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
}
catch (Exception)
{
m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
m_priorityScheme = UpdatePrioritizationSchemes.Time;
}
m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true); try
m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0); {
m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0); m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true);
m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0); }
catch (Exception)
{
m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
m_priorityScheme = UpdatePrioritizationSchemes.Time;
}
m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true);
m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0);
m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0);
m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0);
}
} }
m_log.Info("[SCENE]: Using the " + m_priorityScheme + " prioritization scheme"); m_log.Info("[SCENE]: Using the " + m_priorityScheme + " prioritization scheme");