aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-02-03 17:50:25 +0000
committerJustin Clarke Casey2009-02-03 17:50:25 +0000
commita9e76ce8470062f7e9a1de3a314fd37e675e25a9 (patch)
treeee5cd26fe3f8fea8249b09c54edd1f1400b1c963 /OpenSim
parent* Fixes mantis #3070 (diff)
downloadopensim-SC_OLD-a9e76ce8470062f7e9a1de3a314fd37e675e25a9.zip
opensim-SC_OLD-a9e76ce8470062f7e9a1de3a314fd37e675e25a9.tar.gz
opensim-SC_OLD-a9e76ce8470062f7e9a1de3a314fd37e675e25a9.tar.bz2
opensim-SC_OLD-a9e76ce8470062f7e9a1de3a314fd37e675e25a9.tar.xz
* minor: remove some pointless assignments in SOG.Copy() that had already been done by MemberwiseClone()
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneGraph.cs5
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs16
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs11
4 files changed, 13 insertions, 21 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneGraph.cs b/OpenSim/Region/Environment/Scenes/SceneGraph.cs
index 940aee6..24eaad1 100644
--- a/OpenSim/Region/Environment/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneGraph.cs
@@ -1496,8 +1496,11 @@ namespace OpenSim.Region.Environment.Scenes
1496 // occur on link to invoke this elsewhere (such as object selection) 1496 // occur on link to invoke this elsewhere (such as object selection)
1497 parenPrim.RootPart.AddFlag(PrimFlags.CreateSelected); 1497 parenPrim.RootPart.AddFlag(PrimFlags.CreateSelected);
1498 parenPrim.TriggerScriptChangedEvent(Changed.LINK); 1498 parenPrim.TriggerScriptChangedEvent(Changed.LINK);
1499
1499 if (client != null) 1500 if (client != null)
1501 {
1500 parenPrim.GetProperties(client); 1502 parenPrim.GetProperties(client);
1503 }
1501 else 1504 else
1502 { 1505 {
1503 foreach (ScenePresence p in GetScenePresences()) 1506 foreach (ScenePresence p in GetScenePresences())
@@ -1715,6 +1718,7 @@ namespace OpenSim.Region.Environment.Scenes
1715 // SceneObjectGroup dupe = DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Zero); 1718 // SceneObjectGroup dupe = DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Zero);
1716 DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Identity); 1719 DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Identity);
1717 } 1720 }
1721
1718 /// <summary> 1722 /// <summary>
1719 /// Duplicate the given object. 1723 /// Duplicate the given object.
1720 /// </summary> 1724 /// </summary>
@@ -1780,6 +1784,7 @@ namespace OpenSim.Region.Environment.Scenes
1780 { 1784 {
1781 m_log.WarnFormat("[SCENE]: Attempted to duplicate nonexistant prim id {0}", GroupID); 1785 m_log.WarnFormat("[SCENE]: Attempted to duplicate nonexistant prim id {0}", GroupID);
1782 } 1786 }
1787
1783 return null; 1788 return null;
1784 } 1789 }
1785 1790
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 908bb0d..d026180 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -1053,7 +1053,6 @@ namespace OpenSim.Region.Environment.Scenes
1053 { 1053 {
1054 part.StoreUndoState(); 1054 part.StoreUndoState();
1055 part.OnGrab(offsetPos, remoteClient); 1055 part.OnGrab(offsetPos, remoteClient);
1056
1057 } 1056 }
1058 1057
1059 public virtual void OnGrabGroup(Vector3 offsetPos, IClientAPI remoteClient) 1058 public virtual void OnGrabGroup(Vector3 offsetPos, IClientAPI remoteClient)
@@ -1232,10 +1231,7 @@ namespace OpenSim.Region.Environment.Scenes
1232 // any exception propogate upwards. 1231 // any exception propogate upwards.
1233 1232
1234 if (IsDeleted || UUID == UUID.Zero) 1233 if (IsDeleted || UUID == UUID.Zero)
1235 {
1236// DetachFromBackup();
1237 return; 1234 return;
1238 }
1239 1235
1240 try 1236 try
1241 { 1237 {
@@ -1359,18 +1355,12 @@ namespace OpenSim.Region.Environment.Scenes
1359 /// <returns></returns> 1355 /// <returns></returns>
1360 public SceneObjectGroup Copy(UUID cAgentID, UUID cGroupID, bool userExposed) 1356 public SceneObjectGroup Copy(UUID cAgentID, UUID cGroupID, bool userExposed)
1361 { 1357 {
1362 SceneObjectGroup dupe = (SceneObjectGroup) MemberwiseClone(); 1358 SceneObjectGroup dupe = (SceneObjectGroup)MemberwiseClone();
1363 dupe.m_isBackedUp = false; 1359 dupe.m_isBackedUp = false;
1364 dupe.m_parts = new Dictionary<UUID, SceneObjectPart>(); 1360 dupe.m_parts = new Dictionary<UUID, SceneObjectPart>();
1365 dupe.m_parts.Clear();
1366 //dupe.OwnerID = AgentID;
1367 //dupe.GroupID = GroupID;
1368 dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z); 1361 dupe.AbsolutePosition = new Vector3(AbsolutePosition.X, AbsolutePosition.Y, AbsolutePosition.Z);
1369 dupe.m_scene = m_scene;
1370 dupe.m_regionHandle = m_regionHandle;
1371 1362
1372 dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed); 1363 dupe.CopyRootPart(m_rootPart, OwnerID, GroupID, userExposed);
1373
1374 dupe.m_rootPart.LinkNum = m_rootPart.LinkNum; 1364 dupe.m_rootPart.LinkNum = m_rootPart.LinkNum;
1375 1365
1376 if (userExposed) 1366 if (userExposed)
@@ -1390,7 +1380,6 @@ namespace OpenSim.Region.Environment.Scenes
1390 dupe.RootPart.PhysActor.IsPhysical); 1380 dupe.RootPart.PhysActor.IsPhysical);
1391 1381
1392 dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId; 1382 dupe.RootPart.PhysActor.LocalID = dupe.RootPart.LocalId;
1393
1394 dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true); 1383 dupe.RootPart.DoPhysicsPropertyUpdate(dupe.RootPart.PhysActor.IsPhysical, true);
1395 } 1384 }
1396 1385
@@ -1415,8 +1404,7 @@ namespace OpenSim.Region.Environment.Scenes
1415 { 1404 {
1416 if (part.UUID != m_rootPart.UUID) 1405 if (part.UUID != m_rootPart.UUID)
1417 { 1406 {
1418 SceneObjectPart newPart = 1407 SceneObjectPart newPart = dupe.CopyPart(part, OwnerID, GroupID, userExposed);
1419 dupe.CopyPart(part, OwnerID, GroupID, userExposed);
1420 1408
1421 newPart.LinkNum = part.LinkNum; 1409 newPart.LinkNum = part.LinkNum;
1422 1410
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 0f36e82..256d6f8 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -1380,7 +1380,6 @@ if (m_shape != null) {
1380 if (!userExposed) 1380 if (!userExposed)
1381 dupe.PhysActor = null; 1381 dupe.PhysActor = null;
1382 1382
1383
1384 dupe._ownerID = AgentID; 1383 dupe._ownerID = AgentID;
1385 dupe._groupID = GroupID; 1384 dupe._groupID = GroupID;
1386 dupe.GroupPosition = GroupPosition; 1385 dupe.GroupPosition = GroupPosition;
@@ -1428,6 +1427,7 @@ if (m_shape != null) {
1428 bool UsePhysics = ((dupe.ObjectFlags & (uint)PrimFlags.Physics) != 0); 1427 bool UsePhysics = ((dupe.ObjectFlags & (uint)PrimFlags.Physics) != 0);
1429 dupe.DoPhysicsPropertyUpdate(UsePhysics, true); 1428 dupe.DoPhysicsPropertyUpdate(UsePhysics, true);
1430 } 1429 }
1430
1431 return dupe; 1431 return dupe;
1432 } 1432 }
1433 1433
diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
index ae879bb..ed2eb79 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/SceneObjectTests.cs
@@ -112,7 +112,6 @@ namespace OpenSim.Region.Environment.Scenes.Tests
112 SceneObjectPart part2 = SceneSetupHelpers.AddSceneObject(scene); 112 SceneObjectPart part2 = SceneSetupHelpers.AddSceneObject(scene);
113 SceneObjectGroup grp2 = part2.ParentGroup; 113 SceneObjectGroup grp2 = part2.ParentGroup;
114 114
115
116 grp1.AbsolutePosition = new Vector3(10, 10, 10); 115 grp1.AbsolutePosition = new Vector3(10, 10, 10);
117 grp2.AbsolutePosition = Vector3.Zero; 116 grp2.AbsolutePosition = Vector3.Zero;
118 117
@@ -129,6 +128,10 @@ namespace OpenSim.Region.Environment.Scenes.Tests
129 // Link grp2 to grp1. part2 becomes child prim to grp1. grp2 is eliminated. 128 // Link grp2 to grp1. part2 becomes child prim to grp1. grp2 is eliminated.
130 grp1.LinkToGroup(grp2); 129 grp1.LinkToGroup(grp2);
131 130
131 // FIXME: Can't to these tests yet since group 2 still has the parts attached! We can't yet detach since
132 // it might cause SOG.ProcessBackup() to fail due to the race condition. This really needs to be fixed.
133 //Assert.That(grp2.IsDeleted, "SOG 2 was not registered as deleted after link.");
134 //Assert.That(grp2.Children.Count, Is.EqualTo(0), "Group 2 still contained children after delink.");
132 Assert.That(grp1.Children.Count == 2); 135 Assert.That(grp1.Children.Count == 2);
133 136
134 if (debugtest) 137 if (debugtest)
@@ -170,8 +173,7 @@ namespace OpenSim.Region.Environment.Scenes.Tests
170 if (debugtest) 173 if (debugtest)
171 System.Console.WriteLine("Group2: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part2.AbsolutePosition, part2.RotationOffset); 174 System.Console.WriteLine("Group2: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part2.AbsolutePosition, part2.RotationOffset);
172 175
173 Assert.That(part2.AbsolutePosition == Vector3.Zero); 176 Assert.That(part2.AbsolutePosition == Vector3.Zero);
174
175 } 177 }
176 178
177 [Test] 179 [Test]
@@ -189,7 +191,6 @@ namespace OpenSim.Region.Environment.Scenes.Tests
189 SceneObjectPart part4 = SceneSetupHelpers.AddSceneObject(scene); 191 SceneObjectPart part4 = SceneSetupHelpers.AddSceneObject(scene);
190 SceneObjectGroup grp4 = part4.ParentGroup; 192 SceneObjectGroup grp4 = part4.ParentGroup;
191 193
192
193 grp1.AbsolutePosition = new Vector3(10, 10, 10); 194 grp1.AbsolutePosition = new Vector3(10, 10, 10);
194 grp2.AbsolutePosition = Vector3.Zero; 195 grp2.AbsolutePosition = Vector3.Zero;
195 grp3.AbsolutePosition = new Vector3(20, 20, 20); 196 grp3.AbsolutePosition = new Vector3(20, 20, 20);
@@ -228,7 +229,6 @@ namespace OpenSim.Region.Environment.Scenes.Tests
228 Assert.That(grp1.Children.Count == 2); 229 Assert.That(grp1.Children.Count == 2);
229 Assert.That(grp3.Children.Count == 2); 230 Assert.That(grp3.Children.Count == 2);
230 231
231
232 if (debugtest) 232 if (debugtest)
233 { 233 {
234 System.Console.WriteLine("--------After Link-------"); 234 System.Console.WriteLine("--------After Link-------");
@@ -297,7 +297,6 @@ namespace OpenSim.Region.Environment.Scenes.Tests
297 && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003) 297 && (part4.RotationOffset.Y - compareQuaternion.Y < 0.00003)
298 && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003) 298 && (part4.RotationOffset.Z - compareQuaternion.Z < 0.00003)
299 && (part4.RotationOffset.W - compareQuaternion.W < 0.00003)); 299 && (part4.RotationOffset.W - compareQuaternion.W < 0.00003));
300
301 } 300 }
302 301
303 /// <summary> 302 /// <summary>