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

soprefactor
Melanie 2010-05-21 21:04:17 +01:00
commit 4e23acb133
2 changed files with 72 additions and 73 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");

View File

@ -278,68 +278,64 @@ namespace OpenSim.Region.Framework.Scenes
if (sceneObject == null || sceneObject.RootPart == null || sceneObject.RootPart.UUID == UUID.Zero) if (sceneObject == null || sceneObject.RootPart == null || sceneObject.RootPart.UUID == UUID.Zero)
return false; return false;
bool newlyAdded = false;
if (m_parentScene.m_clampPrimSize)
{
foreach (SceneObjectPart part in sceneObject.Children.Values)
{
Vector3 scale = part.Shape.Scale;
if (scale.X > m_parentScene.m_maxNonphys)
scale.X = m_parentScene.m_maxNonphys;
if (scale.Y > m_parentScene.m_maxNonphys)
scale.Y = m_parentScene.m_maxNonphys;
if (scale.Z > m_parentScene.m_maxNonphys)
scale.Z = m_parentScene.m_maxNonphys;
part.Shape.Scale = scale;
}
}
sceneObject.AttachToScene(m_parentScene);
if (sendClientUpdates)
sceneObject.ScheduleGroupForFullUpdate();
lock (sceneObject) lock (sceneObject)
{ {
if (!Entities.ContainsKey(sceneObject.UUID)) if (Entities.ContainsKey(sceneObject.UUID))
{ {
// m_log.DebugFormat(
// "[SCENE GRAPH]: Adding object {0} {1} to region {2}",
// sceneObject.Name, sceneObject.UUID, m_parentScene.RegionInfo.RegionName);
newlyAdded = true;
Entities.Add(sceneObject);
m_numPrim += sceneObject.Children.Count;
if (attachToBackup)
sceneObject.AttachToBackup();
if (OnObjectCreate != null)
OnObjectCreate(sceneObject);
lock (m_dictionary_lock)
{
SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject;
foreach (SceneObjectPart part in sceneObject.Children.Values)
{
SceneObjectGroupsByFullID[part.UUID] = sceneObject;
SceneObjectGroupsByLocalID[part.LocalId] = sceneObject;
}
}
}
// else
// {
// m_log.WarnFormat( // m_log.WarnFormat(
// "[SCENE GRAPH]: Scene object {0} {1} was already in region {2} on add request", // "[SCENE GRAPH]: Scene object {0} {1} was already in region {2} on add request",
// sceneObject.Name, sceneObject.UUID, m_parentScene.RegionInfo.RegionName); // sceneObject.Name, sceneObject.UUID, m_parentScene.RegionInfo.RegionName);
// } return false;
}
// m_log.DebugFormat(
// "[SCENE GRAPH]: Adding object {0} {1} to region {2}",
// sceneObject.Name, sceneObject.UUID, m_parentScene.RegionInfo.RegionName);
if (m_parentScene.m_clampPrimSize)
{
foreach (SceneObjectPart part in sceneObject.Children.Values)
{
Vector3 scale = part.Shape.Scale;
if (scale.X > m_parentScene.m_maxNonphys)
scale.X = m_parentScene.m_maxNonphys;
if (scale.Y > m_parentScene.m_maxNonphys)
scale.Y = m_parentScene.m_maxNonphys;
if (scale.Z > m_parentScene.m_maxNonphys)
scale.Z = m_parentScene.m_maxNonphys;
part.Shape.Scale = scale;
}
}
sceneObject.AttachToScene(m_parentScene);
if (sendClientUpdates)
sceneObject.ScheduleGroupForFullUpdate();
Entities.Add(sceneObject);
m_numPrim += sceneObject.Children.Count;
if (attachToBackup)
sceneObject.AttachToBackup();
if (OnObjectCreate != null)
OnObjectCreate(sceneObject);
lock (m_dictionary_lock)
{
SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject;
foreach (SceneObjectPart part in sceneObject.Children.Values)
{
SceneObjectGroupsByFullID[part.UUID] = sceneObject;
SceneObjectGroupsByLocalID[part.LocalId] = sceneObject;
}
}
} }
return newlyAdded; return true;
} }
/// <summary> /// <summary>