aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorUbitUmarov2017-01-20 14:26:24 +0000
committerUbitUmarov2017-01-20 14:26:24 +0000
commitdac32c4e5acd76a3b42dede1c573dbef1a98c7e1 (patch)
treee438948fdf10696c2dc98632c18849a76828fe00 /OpenSim/Region/CoreModules
parentremove redundant IsGod, rename some GOD as Administrator (both only on permis... (diff)
downloadopensim-SC_OLD-dac32c4e5acd76a3b42dede1c573dbef1a98c7e1.zip
opensim-SC_OLD-dac32c4e5acd76a3b42dede1c573dbef1a98c7e1.tar.gz
opensim-SC_OLD-dac32c4e5acd76a3b42dede1c573dbef1a98c7e1.tar.bz2
opensim-SC_OLD-dac32c4e5acd76a3b42dede1c573dbef1a98c7e1.tar.xz
change CanObjectEntry() to use a SOG
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs38
2 files changed, 19 insertions, 21 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 6dc982b..92485a1 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -2620,7 +2620,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
2620 { 2620 {
2621 // FIXME: It would be better to never add the scene object at all rather than add it and then delete 2621 // FIXME: It would be better to never add the scene object at all rather than add it and then delete
2622 // it 2622 // it
2623 if (!Scene.Permissions.CanObjectEntry(so.UUID, true, so.AbsolutePosition)) 2623 if (!Scene.Permissions.CanObjectEntry(so, true, so.AbsolutePosition))
2624 { 2624 {
2625 // Deny non attachments based on parcel settings 2625 // Deny non attachments based on parcel settings
2626 // 2626 //
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
index 79308b4..95a007a 100644
--- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs
@@ -1437,42 +1437,40 @@ namespace OpenSim.Region.CoreModules.World.Permissions
1437 return true; 1437 return true;
1438 } 1438 }
1439 1439
1440 private bool CanObjectEntry(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene) 1440 private bool CanObjectEntry(SceneObjectGroup sog, bool enteringRegion, Vector3 newPoint, Scene scene)
1441 { 1441 {
1442 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); 1442 DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
1443 if (m_bypassPermissions) return m_bypassPermissionsValue;
1444
1445 // allow outide region this mb needed for crossings ???
1446 if (newPoint.X < -1f || newPoint.Y < -1f)
1447 return true;
1448 if (newPoint.X > scene.RegionInfo.RegionSizeX + 1.0f || newPoint.Y > scene.RegionInfo.RegionSizeY + 1.0f)
1449 return true;
1450 1443
1451 ILandObject parcel = m_scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y); 1444 if(sog == null || sog.IsDeleted)
1452 if (parcel == null)
1453 return false; 1445 return false;
1454 1446
1455 if ((parcel.LandData.Flags & ((int)ParcelFlags.AllowAPrimitiveEntry)) != 0) 1447 float newX = newPoint.X;
1448 float newY = newPoint.Y;
1449
1450 // allow outside region this mb needed for crossings
1451 if (newX < -1f || newX > (scene.RegionInfo.RegionSizeX + 1.0f) ||
1452 newY < -1f || newY > (scene.RegionInfo.RegionSizeY + 1.0f) )
1456 return true; 1453 return true;
1457 1454
1458 EntityBase ent = null; 1455 if (m_bypassPermissions)
1459 if (!m_scene.Entities.TryGetValue(objectID, out ent)) 1456 return m_bypassPermissionsValue;
1460 return false;
1461 1457
1462 if(ent == null || !(ent is SceneObjectGroup)) 1458 ILandObject parcel = scene.LandChannel.GetLandObject(newX, newY);
1459 if (parcel == null)
1463 return false; 1460 return false;
1464 1461
1465 SceneObjectGroup task = (SceneObjectGroup)ent; 1462 if ((parcel.LandData.Flags & ((int)ParcelFlags.AllowAPrimitiveEntry)) != 0)
1463 return true;
1466 1464
1467 if (!enteringRegion) 1465 if (!enteringRegion)
1468 { 1466 {
1469 ILandObject fromparcel = m_scene.LandChannel.GetLandObject(task.AbsolutePosition.X, task.AbsolutePosition.Y); 1467 Vector3 oldPoint = sog.AbsolutePosition;
1470 1468 ILandObject fromparcel = m_scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y);
1471 if (fromparcel == parcel) // it already entered parcel ???? 1469 if (fromparcel != null && fromparcel.Equals(parcel)) // it already entered parcel ????
1472 return true; 1470 return true;
1473 } 1471 }
1474 1472
1475 if (GenericParcelPermission(task.OwnerID, parcel, 0)) 1473 if (GenericParcelPermission(sog.OwnerID, parcel, 0))
1476 return true; 1474 return true;
1477 1475
1478 //Otherwise, false! 1476 //Otherwise, false!