aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-05-21 21:22:53 +0100
committerJustin Clark-Casey (justincc)2010-05-21 21:22:53 +0100
commitf83acf533b708d7963c5dd1238709898a969c96c (patch)
tree786866e872188939ba5b50a3bf253209aaf9d20b
parentmake oar object filename/pathname creation a helper method (diff)
downloadopensim-SC-f83acf533b708d7963c5dd1238709898a969c96c.zip
opensim-SC-f83acf533b708d7963c5dd1238709898a969c96c.tar.gz
opensim-SC-f83acf533b708d7963c5dd1238709898a969c96c.tar.bz2
opensim-SC-f83acf533b708d7963c5dd1238709898a969c96c.tar.xz
Fix a problem where SceneGraph.AddSceneObject() would return false on successfully adding an object rather than true, in defiance of its method documentation
This meant that the returns were inconsistent - false would be returned both for various scene object failure conditions (e.g. root part was null) and if the object was successfully added.
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs1
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs21
2 files changed, 14 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index 8d62fe1..f97ae5f 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -243,7 +243,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
243 // to the same scene (when this is possible). 243 // to the same scene (when this is possible).
244 sceneObject.ResetIDs(); 244 sceneObject.ResetIDs();
245 245
246
247 foreach (SceneObjectPart part in sceneObject.Children.Values) 246 foreach (SceneObjectPart part in sceneObject.Children.Values)
248 { 247 {
249 if (!ResolveUserUuid(part.CreatorID)) 248 if (!ResolveUserUuid(part.CreatorID))
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index ef13c98..bb570e7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -278,7 +278,7 @@ 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 alreadyExisted = false; 281 bool newlyAdded = false;
282 282
283 if (m_parentScene.m_clampPrimSize) 283 if (m_parentScene.m_clampPrimSize)
284 { 284 {
@@ -305,7 +305,12 @@ namespace OpenSim.Region.Framework.Scenes
305 lock (sceneObject) 305 lock (sceneObject)
306 { 306 {
307 if (!Entities.ContainsKey(sceneObject.UUID)) 307 if (!Entities.ContainsKey(sceneObject.UUID))
308 { 308 {
309// m_log.DebugFormat(
310// "[SCENE GRAPH]: Adding object {0} {1} to region {2}",
311// sceneObject.Name, sceneObject.UUID, m_parentScene.RegionInfo.RegionName);
312
313 newlyAdded = true;
309 Entities.Add(sceneObject); 314 Entities.Add(sceneObject);
310 m_numPrim += sceneObject.Children.Count; 315 m_numPrim += sceneObject.Children.Count;
311 316
@@ -326,13 +331,15 @@ namespace OpenSim.Region.Framework.Scenes
326 } 331 }
327 } 332 }
328 } 333 }
329 else 334// else
330 { 335// {
331 alreadyExisted = true; 336// m_log.WarnFormat(
332 } 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// }
333 } 340 }
334 341
335 return alreadyExisted; 342 return newlyAdded;
336 } 343 }
337 344
338 /// <summary> 345 /// <summary>