diff options
author | Justin Clark-Casey (justincc) | 2010-05-21 22:17:58 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-05-21 22:17:58 +0100 |
commit | 6918446fcdc13d16e010580ac20ff0da94e97f3b (patch) | |
tree | 6e9c8734b9ea32f7f597914b64b5d536791651be /OpenSim | |
parent | Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim (diff) | |
parent | Added a sanity check before using m_config in the Scene constructor (diff) | |
download | opensim-SC-6918446fcdc13d16e010580ac20ff0da94e97f3b.zip opensim-SC-6918446fcdc13d16e010580ac20ff0da94e97f3b.tar.gz opensim-SC-6918446fcdc13d16e010580ac20ff0da94e97f3b.tar.bz2 opensim-SC-6918446fcdc13d16e010580ac20ff0da94e97f3b.tar.xz |
Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Prioritizer.cs | 14 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 35 |
2 files changed, 32 insertions, 17 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index af25014..e6a4642 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs | |||
@@ -5,6 +5,18 @@ using Nini.Config; | |||
5 | using OpenSim.Framework; | 5 | using OpenSim.Framework; |
6 | using OpenMetaverse; | 6 | using OpenMetaverse; |
7 | 7 | ||
8 | /* | ||
9 | * Steps to add a new prioritization policy: | ||
10 | * | ||
11 | * - Add a new value to the UpdatePrioritizationSchemes enum. | ||
12 | * - Specify this new value in the [InterestManagement] section of your | ||
13 | * OpenSim.ini. The name in the config file must match the enum value name | ||
14 | * (although it is not case sensitive). | ||
15 | * - Write a new GetPriorityBy*() method in this class. | ||
16 | * - Add a new entry to the switch statement in GetUpdatePriority() that calls | ||
17 | * your method. | ||
18 | */ | ||
19 | |||
8 | namespace OpenSim.Region.Framework.Scenes | 20 | namespace OpenSim.Region.Framework.Scenes |
9 | { | 21 | { |
10 | public enum UpdatePrioritizationSchemes | 22 | public enum UpdatePrioritizationSchemes |
@@ -35,7 +47,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
35 | case UpdatePrioritizationSchemes.Distance: | 47 | case UpdatePrioritizationSchemes.Distance: |
36 | return GetPriorityByDistance(client, entity); | 48 | return GetPriorityByDistance(client, entity); |
37 | case UpdatePrioritizationSchemes.SimpleAngularDistance: | 49 | case UpdatePrioritizationSchemes.SimpleAngularDistance: |
38 | return GetPriorityByDistance(client, entity); | 50 | return GetPriorityByDistance(client, entity); // TODO: Reimplement SimpleAngularDistance |
39 | case UpdatePrioritizationSchemes.FrontBack: | 51 | case UpdatePrioritizationSchemes.FrontBack: |
40 | return GetPriorityByFrontBack(client, entity); | 52 | return GetPriorityByFrontBack(client, entity); |
41 | default: | 53 | default: |
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"); |