diff options
author | John Hurliman | 2010-05-21 14:17:03 -0700 |
---|---|---|
committer | John Hurliman | 2010-05-21 14:17:03 -0700 |
commit | d0eecf03986b1b1bd7458123a2deed522587b6dc (patch) | |
tree | fc846ccba3c0669acfdfa3b283609d85a0d90d91 | |
parent | * Added code comments to Prioritizer.cs that document how to add a new update... (diff) | |
download | opensim-SC-d0eecf03986b1b1bd7458123a2deed522587b6dc.zip opensim-SC-d0eecf03986b1b1bd7458123a2deed522587b6dc.tar.gz opensim-SC-d0eecf03986b1b1bd7458123a2deed522587b6dc.tar.bz2 opensim-SC-d0eecf03986b1b1bd7458123a2deed522587b6dc.tar.xz |
Added a sanity check before using m_config in the Scene constructor
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f35dffc..46fbcd3 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -794,25 +794,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
794 | 794 | ||
795 | #region Interest Management | 795 | #region Interest Management |
796 | 796 | ||
797 | IConfig interestConfig = m_config.Configs["InterestManagement"]; | 797 | if (m_config != null) |
798 | if (interestConfig != null) | ||
799 | { | 798 | { |
800 | string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower(); | 799 | IConfig interestConfig = m_config.Configs["InterestManagement"]; |
801 | 800 | if (interestConfig != null) | |
802 | try | ||
803 | { | 801 | { |
804 | m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true); | 802 | string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower(); |
805 | } | ||
806 | catch (Exception) | ||
807 | { | ||
808 | m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time"); | ||
809 | m_priorityScheme = UpdatePrioritizationSchemes.Time; | ||
810 | } | ||
811 | 803 | ||
812 | m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true); | 804 | try |
813 | m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0); | 805 | { |
814 | m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0); | 806 | m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true); |
815 | m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0); | 807 | } |
808 | catch (Exception) | ||
809 | { | ||
810 | m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time"); | ||
811 | m_priorityScheme = UpdatePrioritizationSchemes.Time; | ||
812 | } | ||
813 | |||
814 | m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true); | ||
815 | m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0); | ||
816 | m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0); | ||
817 | m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0); | ||
818 | } | ||
816 | } | 819 | } |
817 | 820 | ||
818 | m_log.Info("[SCENE]: Using the " + m_priorityScheme + " prioritization scheme"); | 821 | m_log.Info("[SCENE]: Using the " + m_priorityScheme + " prioritization scheme"); |