aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs35
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs102
2 files changed, 68 insertions, 69 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");
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index bb570e7..e923a92 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -278,68 +278,64 @@ namespace OpenSim.Region.Framework.Scenes
278 if (sceneObject == null || sceneObject.RootPart == null || sceneObject.RootPart.UUID == UUID.Zero) 278 if (sceneObject == null || sceneObject.RootPart == null || sceneObject.RootPart.UUID == UUID.Zero)
279 return false; 279 return false;
280 280
281 bool newlyAdded = false; 281 lock (sceneObject)
282 282 {
283 if (m_parentScene.m_clampPrimSize) 283 if (Entities.ContainsKey(sceneObject.UUID))
284 {
285 foreach (SceneObjectPart part in sceneObject.Children.Values)
286 { 284 {
287 Vector3 scale = part.Shape.Scale; 285// m_log.WarnFormat(
288 286// "[SCENE GRAPH]: Scene object {0} {1} was already in region {2} on add request",
289 if (scale.X > m_parentScene.m_maxNonphys) 287// sceneObject.Name, sceneObject.UUID, m_parentScene.RegionInfo.RegionName);
290 scale.X = m_parentScene.m_maxNonphys; 288 return false;
291 if (scale.Y > m_parentScene.m_maxNonphys)
292 scale.Y = m_parentScene.m_maxNonphys;
293 if (scale.Z > m_parentScene.m_maxNonphys)
294 scale.Z = m_parentScene.m_maxNonphys;
295
296 part.Shape.Scale = scale;
297 } 289 }
298 } 290
299
300 sceneObject.AttachToScene(m_parentScene);
301
302 if (sendClientUpdates)
303 sceneObject.ScheduleGroupForFullUpdate();
304
305 lock (sceneObject)
306 {
307 if (!Entities.ContainsKey(sceneObject.UUID))
308 {
309// m_log.DebugFormat( 291// m_log.DebugFormat(
310// "[SCENE GRAPH]: Adding object {0} {1} to region {2}", 292// "[SCENE GRAPH]: Adding object {0} {1} to region {2}",
311// sceneObject.Name, sceneObject.UUID, m_parentScene.RegionInfo.RegionName); 293// sceneObject.Name, sceneObject.UUID, m_parentScene.RegionInfo.RegionName);
312 294
313 newlyAdded = true; 295 if (m_parentScene.m_clampPrimSize)
314 Entities.Add(sceneObject); 296 {
315 m_numPrim += sceneObject.Children.Count; 297 foreach (SceneObjectPart part in sceneObject.Children.Values)
316
317 if (attachToBackup)
318 sceneObject.AttachToBackup();
319
320 if (OnObjectCreate != null)
321 OnObjectCreate(sceneObject);
322
323 lock (m_dictionary_lock)
324 { 298 {
325 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject; 299 Vector3 scale = part.Shape.Scale;
326 SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject; 300
327 foreach (SceneObjectPart part in sceneObject.Children.Values) 301 if (scale.X > m_parentScene.m_maxNonphys)
328 { 302 scale.X = m_parentScene.m_maxNonphys;
329 SceneObjectGroupsByFullID[part.UUID] = sceneObject; 303 if (scale.Y > m_parentScene.m_maxNonphys)
330 SceneObjectGroupsByLocalID[part.LocalId] = sceneObject; 304 scale.Y = m_parentScene.m_maxNonphys;
331 } 305 if (scale.Z > m_parentScene.m_maxNonphys)
306 scale.Z = m_parentScene.m_maxNonphys;
307
308 part.Shape.Scale = scale;
309 }
310 }
311
312 sceneObject.AttachToScene(m_parentScene);
313
314 if (sendClientUpdates)
315 sceneObject.ScheduleGroupForFullUpdate();
316
317 Entities.Add(sceneObject);
318 m_numPrim += sceneObject.Children.Count;
319
320 if (attachToBackup)
321 sceneObject.AttachToBackup();
322
323 if (OnObjectCreate != null)
324 OnObjectCreate(sceneObject);
325
326 lock (m_dictionary_lock)
327 {
328 SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
329 SceneObjectGroupsByLocalID[sceneObject.LocalId] = sceneObject;
330 foreach (SceneObjectPart part in sceneObject.Children.Values)
331 {
332 SceneObjectGroupsByFullID[part.UUID] = sceneObject;
333 SceneObjectGroupsByLocalID[part.LocalId] = sceneObject;
332 } 334 }
333 } 335 }
334// else
335// {
336// m_log.WarnFormat(
337// "[SCENE GRAPH]: Scene object {0} {1} was already in region {2} on add request",
338// sceneObject.Name, sceneObject.UUID, m_parentScene.RegionInfo.RegionName);
339// }
340 } 336 }
341 337
342 return newlyAdded; 338 return true;
343 } 339 }
344 340
345 /// <summary> 341 /// <summary>