Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim

soprefactor
Justin Clark-Casey (justincc) 2010-05-21 22:17:58 +01:00
commit 6918446fcd
2 changed files with 32 additions and 17 deletions

View File

@ -5,6 +5,18 @@ using Nini.Config;
using OpenSim.Framework;
using OpenMetaverse;
/*
* Steps to add a new prioritization policy:
*
* - Add a new value to the UpdatePrioritizationSchemes enum.
* - Specify this new value in the [InterestManagement] section of your
* OpenSim.ini. The name in the config file must match the enum value name
* (although it is not case sensitive).
* - Write a new GetPriorityBy*() method in this class.
* - Add a new entry to the switch statement in GetUpdatePriority() that calls
* your method.
*/
namespace OpenSim.Region.Framework.Scenes
{
public enum UpdatePrioritizationSchemes
@ -35,7 +47,7 @@ namespace OpenSim.Region.Framework.Scenes
case UpdatePrioritizationSchemes.Distance:
return GetPriorityByDistance(client, entity);
case UpdatePrioritizationSchemes.SimpleAngularDistance:
return GetPriorityByDistance(client, entity);
return GetPriorityByDistance(client, entity); // TODO: Reimplement SimpleAngularDistance
case UpdatePrioritizationSchemes.FrontBack:
return GetPriorityByFrontBack(client, entity);
default:

View File

@ -794,25 +794,28 @@ namespace OpenSim.Region.Framework.Scenes
#region Interest Management
IConfig interestConfig = m_config.Configs["InterestManagement"];
if (interestConfig != null)
if (m_config != null)
{
string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
try
IConfig interestConfig = m_config.Configs["InterestManagement"];
if (interestConfig != null)
{
m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true);
}
catch (Exception)
{
m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
m_priorityScheme = UpdatePrioritizationSchemes.Time;
}
string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
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);
try
{
m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true);
}
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");