diff options
author | Melanie | 2010-09-21 04:03:14 +0100 |
---|---|---|
committer | Melanie | 2010-09-21 04:03:14 +0100 |
commit | 9feef34a8144ee7661f8c6207a2a2e432c58eccf (patch) | |
tree | 7e04dfd88a6d02ff7fd2b2e45bf0d92d8db90ec8 /OpenSim/Region/Framework | |
parent | Overwrite the core version of the string parsing method with ours (diff) | |
parent | Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff) | |
download | opensim-SC-9feef34a8144ee7661f8c6207a2a2e432c58eccf.zip opensim-SC-9feef34a8144ee7661f8c6207a2a2e432c58eccf.tar.gz opensim-SC-9feef34a8144ee7661f8c6207a2a2e432c58eccf.tar.bz2 opensim-SC-9feef34a8144ee7661f8c6207a2a2e432c58eccf.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework')
3 files changed, 41 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index ac82fda..18cfcbc 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1532,16 +1532,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1532 | if (part == null) | 1532 | if (part == null) |
1533 | return; | 1533 | return; |
1534 | 1534 | ||
1535 | if (part.OwnerID != remoteClient.AgentId) | ||
1536 | { | ||
1537 | // Group permissions | ||
1538 | if ((part.GroupID == UUID.Zero) || (remoteClient.GetGroupPowers(part.GroupID) == 0) || ((part.GroupMask & (uint)PermissionMask.Modify) == 0)) | ||
1539 | return; | ||
1540 | } else { | ||
1541 | if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) | ||
1542 | return; | ||
1543 | } | ||
1544 | |||
1545 | if (!Permissions.CanCreateObjectInventory( | 1535 | if (!Permissions.CanCreateObjectInventory( |
1546 | itemBase.InvType, part.UUID, remoteClient.AgentId)) | 1536 | itemBase.InvType, part.UUID, remoteClient.AgentId)) |
1547 | return; | 1537 | return; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index f9bfffd..62245d4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -424,8 +424,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
424 | get { return m_rootPart.UUID; } | 424 | get { return m_rootPart.UUID; } |
425 | set | 425 | set |
426 | { | 426 | { |
427 | m_rootPart.UUID = value; | 427 | lock (m_parts.SyncRoot) |
428 | m_parts.AddOrReplace(value, m_rootPart); | 428 | { |
429 | m_parts.Remove(m_rootPart.UUID); | ||
430 | m_rootPart.UUID = value; | ||
431 | m_parts.Add(value, m_rootPart); | ||
432 | } | ||
429 | } | 433 | } |
430 | } | 434 | } |
431 | 435 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index 54b3260..e6ff0c0 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs | |||
@@ -189,5 +189,40 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
189 | // SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); | 189 | // SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); |
190 | // Assert.That(retrievedPart, Is.Null); | 190 | // Assert.That(retrievedPart, Is.Null); |
191 | //} | 191 | //} |
192 | |||
193 | /// <summary> | ||
194 | /// Changing a scene object uuid changes the root part uuid. This is a valid operation if the object is not | ||
195 | /// in a scene and is useful if one wants to supply a UUID directly rather than use the one generated by | ||
196 | /// OpenSim. | ||
197 | /// </summary> | ||
198 | [Test] | ||
199 | public void TestChangeSceneObjectUuid() | ||
200 | { | ||
201 | string rootPartName = "rootpart"; | ||
202 | UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001"); | ||
203 | string childPartName = "childPart"; | ||
204 | UUID childPartUuid = new UUID("00000000-0000-0000-0001-000000000000"); | ||
205 | |||
206 | SceneObjectPart rootPart | ||
207 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | ||
208 | { Name = rootPartName, UUID = rootPartUuid }; | ||
209 | SceneObjectPart linkPart | ||
210 | = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | ||
211 | { Name = childPartName, UUID = childPartUuid }; | ||
212 | |||
213 | SceneObjectGroup sog = new SceneObjectGroup(rootPart); | ||
214 | sog.AddPart(linkPart); | ||
215 | |||
216 | Assert.That(sog.UUID, Is.EqualTo(rootPartUuid)); | ||
217 | Assert.That(sog.RootPart.UUID, Is.EqualTo(rootPartUuid)); | ||
218 | Assert.That(sog.Parts.Length, Is.EqualTo(2)); | ||
219 | |||
220 | UUID newRootPartUuid = new UUID("00000000-0000-0000-0000-000000000002"); | ||
221 | sog.UUID = newRootPartUuid; | ||
222 | |||
223 | Assert.That(sog.UUID, Is.EqualTo(newRootPartUuid)); | ||
224 | Assert.That(sog.RootPart.UUID, Is.EqualTo(newRootPartUuid)); | ||
225 | Assert.That(sog.Parts.Length, Is.EqualTo(2)); | ||
226 | } | ||
192 | } | 227 | } |
193 | } | 228 | } |