Attempt to reinstate the Object Entry flag in parcel settings
0.6.1-post-fixes
Melanie Thielker 2008-11-22 00:23:48 +00:00
parent 48cf76efe7
commit 691c4bc756
4 changed files with 18 additions and 7 deletions

View File

@ -936,7 +936,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
return permission; 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); DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
if (m_bypassPermissions) return m_bypassPermissionsValue; if (m_bypassPermissions) return m_bypassPermissionsValue;
@ -946,8 +946,18 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
return true; return true;
} }
SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID];
ILandObject land = m_scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y); 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) if (land == null)
{ {
return false; return false;
@ -971,7 +981,6 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
return false; return false;
} }
SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objectID];
if (GenericParcelPermission(task.OwnerID, newPoint)) if (GenericParcelPermission(task.OwnerID, newPoint))
{ {

View File

@ -403,7 +403,7 @@ namespace OpenSim.Region.Environment.Scenes
#endregion #endregion
#region OBJECT ENTRY #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<CanObjectEntryHandler> CanObjectEntryCheckFunctions = new List<CanObjectEntryHandler>(); private List<CanObjectEntryHandler> CanObjectEntryCheckFunctions = new List<CanObjectEntryHandler>();
public void AddObjectEntryHandler(CanObjectEntryHandler delegateFunc) public void AddObjectEntryHandler(CanObjectEntryHandler delegateFunc)
@ -418,11 +418,11 @@ namespace OpenSim.Region.Environment.Scenes
CanObjectEntryCheckFunctions.Remove(delegateFunc); CanObjectEntryCheckFunctions.Remove(delegateFunc);
} }
public bool CanObjectEntry(UUID objectID, Vector3 newPoint) public bool CanObjectEntry(UUID objectID, bool enteringRegion, Vector3 newPoint)
{ {
foreach (CanObjectEntryHandler check in CanObjectEntryCheckFunctions) foreach (CanObjectEntryHandler check in CanObjectEntryCheckFunctions)
{ {
if (check(objectID, newPoint, m_scene) == false) if (check(objectID, enteringRegion, newPoint, m_scene) == false)
{ {
return false; return false;
} }

View File

@ -2157,12 +2157,14 @@ namespace OpenSim.Region.Environment.Scenes
if (XMLMethod == 0) if (XMLMethod == 0)
{ {
SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData);
AddRestoredSceneObject(sceneObject, true, false); AddRestoredSceneObject(sceneObject, true, false);
SceneObjectPart RootPrim = GetSceneObjectPart(primID); SceneObjectPart RootPrim = GetSceneObjectPart(primID);
if (RootPrim != null) 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; SceneObjectGroup grp = RootPrim.ParentGroup;
if (grp != null) if (grp != null)

View File

@ -1185,7 +1185,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
else 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); group.UpdateGroupPosition(pos);
} }