diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 61 |
1 files changed, 16 insertions, 45 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 7a97bfc..ba2ee04 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1379,7 +1379,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1379 | if ((data.change & (ObjectChangeType.Position | ObjectChangeType.Rotation)) != 0) | 1379 | if ((data.change & (ObjectChangeType.Position | ObjectChangeType.Rotation)) != 0) |
1380 | { | 1380 | { |
1381 | // Are we allowed to move it? | 1381 | // Are we allowed to move it? |
1382 | if (m_parentScene.Permissions.CanMoveObject(grp.UUID, remoteClient.AgentId)) | 1382 | if (m_parentScene.Permissions.CanMoveObject(grp, remoteClient)) |
1383 | { | 1383 | { |
1384 | // Strip all but move and rotation from request | 1384 | // Strip all but move and rotation from request |
1385 | data.change &= (ObjectChangeType.Group | ObjectChangeType.Position | ObjectChangeType.Rotation); | 1385 | data.change &= (ObjectChangeType.Group | ObjectChangeType.Position | ObjectChangeType.Rotation); |
@@ -1474,7 +1474,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1474 | SceneObjectGroup group = GetGroupByPrim(localID); | 1474 | SceneObjectGroup group = GetGroupByPrim(localID); |
1475 | if (group != null) | 1475 | if (group != null) |
1476 | { | 1476 | { |
1477 | if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId)) | 1477 | if (m_parentScene.Permissions.CanMoveObject(group, remoteClient)) |
1478 | { | 1478 | { |
1479 | group.UpdateSingleRotation(rot, localID); | 1479 | group.UpdateSingleRotation(rot, localID); |
1480 | } | 1480 | } |
@@ -1492,7 +1492,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1492 | SceneObjectGroup group = GetGroupByPrim(localID); | 1492 | SceneObjectGroup group = GetGroupByPrim(localID); |
1493 | if (group != null) | 1493 | if (group != null) |
1494 | { | 1494 | { |
1495 | if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId)) | 1495 | if (m_parentScene.Permissions.CanMoveObject(group, remoteClient)) |
1496 | { | 1496 | { |
1497 | group.UpdateSingleRotation(rot, pos, localID); | 1497 | group.UpdateSingleRotation(rot, pos, localID); |
1498 | } | 1498 | } |
@@ -1510,7 +1510,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1510 | SceneObjectGroup group = GetGroupByPrim(localID); | 1510 | SceneObjectGroup group = GetGroupByPrim(localID); |
1511 | if (group != null) | 1511 | if (group != null) |
1512 | { | 1512 | { |
1513 | if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId)) | 1513 | if (m_parentScene.Permissions.CanMoveObject(group, remoteClient)) |
1514 | { | 1514 | { |
1515 | group.UpdateGroupRotationR(rot); | 1515 | group.UpdateGroupRotationR(rot); |
1516 | } | 1516 | } |
@@ -1529,7 +1529,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1529 | SceneObjectGroup group = GetGroupByPrim(localID); | 1529 | SceneObjectGroup group = GetGroupByPrim(localID); |
1530 | if (group != null) | 1530 | if (group != null) |
1531 | { | 1531 | { |
1532 | if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId)) | 1532 | if (m_parentScene.Permissions.CanMoveObject(group, remoteClient)) |
1533 | { | 1533 | { |
1534 | group.UpdateGroupRotationPR(pos, rot); | 1534 | group.UpdateGroupRotationPR(pos, rot); |
1535 | } | 1535 | } |
@@ -1547,7 +1547,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1547 | SceneObjectGroup group = GetGroupByPrim(localID); | 1547 | SceneObjectGroup group = GetGroupByPrim(localID); |
1548 | if (group != null) | 1548 | if (group != null) |
1549 | { | 1549 | { |
1550 | if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId) || group.IsAttachment) | 1550 | if (m_parentScene.Permissions.CanMoveObject(group, remoteClient) || group.IsAttachment) |
1551 | { | 1551 | { |
1552 | group.UpdateSinglePosition(pos, localID); | 1552 | group.UpdateSinglePosition(pos, localID); |
1553 | } | 1553 | } |
@@ -1562,17 +1562,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1562 | /// <param name="remoteClient"></param> | 1562 | /// <param name="remoteClient"></param> |
1563 | public void UpdatePrimGroupPosition(uint localId, Vector3 pos, IClientAPI remoteClient) | 1563 | public void UpdatePrimGroupPosition(uint localId, Vector3 pos, IClientAPI remoteClient) |
1564 | { | 1564 | { |
1565 | UpdatePrimGroupPosition(localId, pos, remoteClient.AgentId); | ||
1566 | } | ||
1567 | |||
1568 | /// <summary> | ||
1569 | /// Update the position of the given group. | ||
1570 | /// </summary> | ||
1571 | /// <param name="localId"></param> | ||
1572 | /// <param name="pos"></param> | ||
1573 | /// <param name="updatingAgentId"></param> | ||
1574 | public void UpdatePrimGroupPosition(uint localId, Vector3 pos, UUID updatingAgentId) | ||
1575 | { | ||
1576 | SceneObjectGroup group = GetGroupByPrim(localId); | 1565 | SceneObjectGroup group = GetGroupByPrim(localId); |
1577 | 1566 | ||
1578 | if (group != null) | 1567 | if (group != null) |
@@ -1589,7 +1578,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1589 | } | 1578 | } |
1590 | else | 1579 | else |
1591 | { | 1580 | { |
1592 | if (m_parentScene.Permissions.CanMoveObject(group.UUID, updatingAgentId) | 1581 | if (m_parentScene.Permissions.CanMoveObject(group, remoteClient) |
1593 | && m_parentScene.Permissions.CanObjectEntry(group.UUID, false, pos)) | 1582 | && m_parentScene.Permissions.CanObjectEntry(group.UUID, false, pos)) |
1594 | { | 1583 | { |
1595 | group.UpdateGroupPosition(pos); | 1584 | group.UpdateGroupPosition(pos); |
@@ -2025,27 +2014,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2025 | 2014 | ||
2026 | protected internal void MakeObjectSearchable(IClientAPI remoteClient, bool IncludeInSearch, uint localID) | 2015 | protected internal void MakeObjectSearchable(IClientAPI remoteClient, bool IncludeInSearch, uint localID) |
2027 | { | 2016 | { |
2028 | UUID user = remoteClient.AgentId; | 2017 | SceneObjectGroup sog = GetGroupByPrim(localID); |
2029 | UUID objid = UUID.Zero; | 2018 | if(sog == null) |
2030 | SceneObjectPart obj = null; | 2019 | return; |
2031 | |||
2032 | EntityBase[] entityList = GetEntities(); | ||
2033 | foreach (EntityBase ent in entityList) | ||
2034 | { | ||
2035 | if (ent is SceneObjectGroup) | ||
2036 | { | ||
2037 | SceneObjectGroup sog = ent as SceneObjectGroup; | ||
2038 | |||
2039 | foreach (SceneObjectPart part in sog.Parts) | ||
2040 | { | ||
2041 | if (part.LocalId == localID) | ||
2042 | { | ||
2043 | objid = part.UUID; | ||
2044 | obj = part; | ||
2045 | } | ||
2046 | } | ||
2047 | } | ||
2048 | } | ||
2049 | 2020 | ||
2050 | //Protip: In my day, we didn't call them searchable objects, we called them limited point-to-point joints | 2021 | //Protip: In my day, we didn't call them searchable objects, we called them limited point-to-point joints |
2051 | //aka ObjectFlags.JointWheel = IncludeInSearch | 2022 | //aka ObjectFlags.JointWheel = IncludeInSearch |
@@ -2062,15 +2033,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
2062 | // libomv will complain about PrimFlags.JointWheel being | 2033 | // libomv will complain about PrimFlags.JointWheel being |
2063 | // deprecated, so we | 2034 | // deprecated, so we |
2064 | #pragma warning disable 0612 | 2035 | #pragma warning disable 0612 |
2065 | if (IncludeInSearch && m_parentScene.Permissions.CanEditObject(objid, user)) | 2036 | if (IncludeInSearch && m_parentScene.Permissions.CanEditObject(sog.UUID, remoteClient.AgentId)) |
2066 | { | 2037 | { |
2067 | obj.ParentGroup.RootPart.AddFlag(PrimFlags.JointWheel); | 2038 | sog.RootPart.AddFlag(PrimFlags.JointWheel); |
2068 | obj.ParentGroup.HasGroupChanged = true; | 2039 | sog.HasGroupChanged = true; |
2069 | } | 2040 | } |
2070 | else if (!IncludeInSearch && m_parentScene.Permissions.CanMoveObject(objid,user)) | 2041 | else if (!IncludeInSearch && m_parentScene.Permissions.CanMoveObject(sog, remoteClient)) |
2071 | { | 2042 | { |
2072 | obj.ParentGroup.RootPart.RemFlag(PrimFlags.JointWheel); | 2043 | sog.RootPart.RemFlag(PrimFlags.JointWheel); |
2073 | obj.ParentGroup.HasGroupChanged = true; | 2044 | sog.HasGroupChanged = true; |
2074 | } | 2045 | } |
2075 | #pragma warning restore 0612 | 2046 | #pragma warning restore 0612 |
2076 | } | 2047 | } |