aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-03-26 02:05:53 +0000
committerJustin Clark-Casey (justincc)2011-03-26 02:05:53 +0000
commitbfd9cc44b40e64af3c7504d43a15b7e1b44070a0 (patch)
tree25776df2f787778fa42b2959430e6e4c211f638b
parentMerge branch 'master' into primcounts (diff)
downloadopensim-SC_OLD-bfd9cc44b40e64af3c7504d43a15b7e1b44070a0.zip
opensim-SC_OLD-bfd9cc44b40e64af3c7504d43a15b7e1b44070a0.tar.gz
opensim-SC_OLD-bfd9cc44b40e64af3c7504d43a15b7e1b44070a0.tar.bz2
opensim-SC_OLD-bfd9cc44b40e64af3c7504d43a15b7e1b44070a0.tar.xz
When an object is duplicated, add the dupe to the uuid/local id indexes as well as the basic entities list.
Added a prim counts test to reinforce this - shift-copy was no incrementing prim count. This will sometime become a basic scene test. New code needs to be refactored so we just call SceneGraph.AddSceneObject(). This will happen in the near future. With this, basic owner prim counts on a single parcel appear to be working fine (with the same previous existing taint calls as used by the land management module). More work to do.
-rw-r--r--OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs23
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs30
2 files changed, 52 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
index 80b2859..dd55f98 100644
--- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
+++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs
@@ -105,6 +105,29 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests
105 } 105 }
106 106
107 /// <summary> 107 /// <summary>
108 /// Test count after a parcel owner owned copied object is added.
109 /// </summary>
110 [Test]
111 public void TestCopiedOwnerObject()
112 {
113 TestHelper.InMethod();
114// log4net.Config.XmlConfigurator.Configure();
115
116 IPrimCounts pc = m_lo.PrimCounts;
117
118 SceneObjectGroup sog = SceneSetupHelpers.CreateSceneObject(3, m_userId, 0x01);
119 m_scene.AddNewSceneObject(sog, false);
120 m_scene.SceneGraph.DuplicateObject(sog.LocalId, Vector3.Zero, 0, m_userId, UUID.Zero, Quaternion.Identity);
121
122 Assert.That(pc.Owner, Is.EqualTo(6));
123 Assert.That(pc.Group, Is.EqualTo(0));
124 Assert.That(pc.Others, Is.EqualTo(0));
125 Assert.That(pc.Users[m_userId], Is.EqualTo(6));
126 Assert.That(pc.Users[m_dummyUserId], Is.EqualTo(0));
127 Assert.That(pc.Simulator, Is.EqualTo(6));
128 }
129
130 /// <summary>
108 /// Test count after a parcel owner owned object is removed. 131 /// Test count after a parcel owner owned object is removed.
109 /// </summary> 132 /// </summary>
110 [Test] 133 [Test]
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 1621398..60855b2 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -363,6 +363,10 @@ namespace OpenSim.Region.Framework.Scenes
363 363
364 if (Entities.ContainsKey(sceneObject.UUID)) 364 if (Entities.ContainsKey(sceneObject.UUID))
365 return false; 365 return false;
366
367// m_log.DebugFormat(
368// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}",
369// sceneObject.Name, sceneObject.UUID, sceneObject.Parts.Length, m_parentScene.RegionInfo.RegionName);
366 370
367 SceneObjectPart[] children = sceneObject.Parts; 371 SceneObjectPart[] children = sceneObject.Parts;
368 372
@@ -1798,7 +1802,10 @@ namespace OpenSim.Region.Framework.Scenes
1798 /// <param name="rot"></param> 1802 /// <param name="rot"></param>
1799 public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot) 1803 public SceneObjectGroup DuplicateObject(uint originalPrimID, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot)
1800 { 1804 {
1801 //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); 1805// m_log.DebugFormat(
1806// "[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}",
1807// originalPrimID, offset, AgentID);
1808
1802 SceneObjectGroup original = GetGroupByPrim(originalPrimID); 1809 SceneObjectGroup original = GetGroupByPrim(originalPrimID);
1803 if (original != null) 1810 if (original != null)
1804 { 1811 {
@@ -1829,7 +1836,28 @@ namespace OpenSim.Region.Framework.Scenes
1829 copy.RootPart.SalePrice = 10; 1836 copy.RootPart.SalePrice = 10;
1830 } 1837 }
1831 1838
1839 // FIXME: This section needs to be refactored so that it just calls AddSceneObject()
1832 Entities.Add(copy); 1840 Entities.Add(copy);
1841
1842 lock (SceneObjectGroupsByFullID)
1843 SceneObjectGroupsByFullID[copy.UUID] = copy;
1844
1845 SceneObjectPart[] children = copy.Parts;
1846
1847 lock (SceneObjectGroupsByFullPartID)
1848 {
1849 SceneObjectGroupsByFullPartID[copy.UUID] = copy;
1850 foreach (SceneObjectPart part in children)
1851 SceneObjectGroupsByFullPartID[part.UUID] = copy;
1852 }
1853
1854 lock (SceneObjectGroupsByLocalPartID)
1855 {
1856 SceneObjectGroupsByLocalPartID[copy.LocalId] = copy;
1857 foreach (SceneObjectPart part in children)
1858 SceneObjectGroupsByLocalPartID[copy.LocalId] = copy;
1859 }
1860 // PROBABLE END OF FIXME
1833 1861
1834 // Since we copy from a source group that is in selected 1862 // Since we copy from a source group that is in selected
1835 // state, but the copy is shown deselected in the viewer, 1863 // state, but the copy is shown deselected in the viewer,