From 691c4bc756b9565e648ff8ad88cfbfabd1b0be76 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 22 Nov 2008 00:23:48 +0000 Subject: [PATCH] Mantis #2442 Attempt to reinstate the Object Entry flag in parcel settings --- .../Modules/World/Permissions/PermissionsModule.cs | 13 +++++++++++-- .../Region/Environment/Scenes/Scene.Permissions.cs | 6 +++--- OpenSim/Region/Environment/Scenes/Scene.cs | 4 +++- OpenSim/Region/Environment/Scenes/SceneGraph.cs | 2 +- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs index 9eeff0f8eb..681182ef43 100644 --- a/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Permissions/PermissionsModule.cs @@ -936,7 +936,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return permission; } - private bool CanObjectEntry(UUID objectID, Vector3 newPoint, Scene scene) + private bool CanObjectEntry(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene) { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; @@ -946,8 +946,18 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return true; } + SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID]; + ILandObject land = m_scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y); + if(!enteringRegion) + { + ILandObject fromland = m_scene.LandChannel.GetLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y); + + if (fromland == land) // Not entering + return true; + } + if (land == null) { return false; @@ -971,7 +981,6 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions return false; } - SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID]; if (GenericParcelPermission(task.OwnerID, newPoint)) { diff --git a/OpenSim/Region/Environment/Scenes/Scene.Permissions.cs b/OpenSim/Region/Environment/Scenes/Scene.Permissions.cs index 3a5a3d1fd5..5f3b100c42 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Permissions.cs @@ -403,7 +403,7 @@ namespace OpenSim.Region.Environment.Scenes #endregion #region OBJECT ENTRY - public delegate bool CanObjectEntryHandler(UUID objectID, Vector3 newPoint, Scene scene); + public delegate bool CanObjectEntryHandler(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene); private List CanObjectEntryCheckFunctions = new List(); public void AddObjectEntryHandler(CanObjectEntryHandler delegateFunc) @@ -418,11 +418,11 @@ namespace OpenSim.Region.Environment.Scenes CanObjectEntryCheckFunctions.Remove(delegateFunc); } - public bool CanObjectEntry(UUID objectID, Vector3 newPoint) + public bool CanObjectEntry(UUID objectID, bool enteringRegion, Vector3 newPoint) { foreach (CanObjectEntryHandler check in CanObjectEntryCheckFunctions) { - if (check(objectID, newPoint, m_scene) == false) + if (check(objectID, enteringRegion, newPoint, m_scene) == false) { return false; } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 723f874948..2fcca43b32 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -2157,12 +2157,14 @@ namespace OpenSim.Region.Environment.Scenes if (XMLMethod == 0) { SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); + AddRestoredSceneObject(sceneObject, true, false); SceneObjectPart RootPrim = GetSceneObjectPart(primID); if (RootPrim != null) { - if (m_regInfo.EstateSettings.IsBanned(RootPrim.OwnerID)) + if (m_regInfo.EstateSettings.IsBanned(RootPrim.OwnerID) || + Permissions.CanObjectEntry(RootPrim.UUID, true, RootPrim.AbsolutePosition)) { SceneObjectGroup grp = RootPrim.ParentGroup; if (grp != null) diff --git a/OpenSim/Region/Environment/Scenes/SceneGraph.cs b/OpenSim/Region/Environment/Scenes/SceneGraph.cs index 4c15da24b5..f1ef6c31a0 100644 --- a/OpenSim/Region/Environment/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Environment/Scenes/SceneGraph.cs @@ -1185,7 +1185,7 @@ namespace OpenSim.Region.Environment.Scenes } else { - if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId) || group.IsAttachment) + if ((m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId) && m_parentScene.Permissions.CanObjectEntry(group.UUID, false, pos)) || group.IsAttachment) { group.UpdateGroupPosition(pos); }