diff options
author | UbitUmarov | 2017-06-26 19:40:20 +0100 |
---|---|---|
committer | UbitUmarov | 2017-06-26 19:40:20 +0100 |
commit | f660aa37ac7c8b935c2f317c2d4a1907c0ab9ed2 (patch) | |
tree | 0efb0ad7e3326eaaa41fd09ba2ac801957c17062 /OpenSim/Region | |
parent | let osTeleport* always work on script prim owner (diff) | |
download | opensim-SC-f660aa37ac7c8b935c2f317c2d4a1907c0ab9ed2.zip opensim-SC-f660aa37ac7c8b935c2f317c2d4a1907c0ab9ed2.tar.gz opensim-SC-f660aa37ac7c8b935c2f317c2d4a1907c0ab9ed2.tar.bz2 opensim-SC-f660aa37ac7c8b935c2f317c2d4a1907c0ab9ed2.tar.xz |
add similar restrictions to osObjectTeleport :(
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index d665f69..1a88529 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -876,7 +876,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
876 | if(landdata.OwnerID == hostOwner) | 876 | if(landdata.OwnerID == hostOwner) |
877 | return true; | 877 | return true; |
878 | 878 | ||
879 | if(World.RegionInfo.EstateSettings != null && World.RegionInfo.EstateSettings.IsEstateManagerOrOwner(hostOwner)) | 879 | EstateSettings es = World.RegionInfo.EstateSettings; |
880 | if(es != null && es.IsEstateManagerOrOwner(hostOwner)) | ||
880 | return true; | 881 | return true; |
881 | 882 | ||
882 | if(!landdata.IsGroupOwned) | 883 | if(!landdata.IsGroupOwned) |
@@ -4756,6 +4757,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4756 | sog.SetInertiaData(-1, Vector3.Zero, Vector3.Zero, Vector4.Zero ); | 4757 | sog.SetInertiaData(-1, Vector3.Zero, Vector3.Zero, Vector4.Zero ); |
4757 | } | 4758 | } |
4758 | 4759 | ||
4760 | private bool checkAllowObjectTPbyLandOwner(Vector3 pos) | ||
4761 | { | ||
4762 | ILandObject land = World.LandChannel.GetLandObject(pos); | ||
4763 | if(land == null) | ||
4764 | return true; | ||
4765 | |||
4766 | LandData landdata = land.LandData; | ||
4767 | if(landdata == null) | ||
4768 | return true; | ||
4769 | |||
4770 | UUID hostOwner = m_host.OwnerID; | ||
4771 | if(landdata.OwnerID == hostOwner) | ||
4772 | return true; | ||
4773 | |||
4774 | EstateSettings es = World.RegionInfo.EstateSettings; | ||
4775 | if(es != null && es.IsEstateManagerOrOwner(hostOwner)) | ||
4776 | return true; | ||
4777 | |||
4778 | if(!landdata.IsGroupOwned) | ||
4779 | return false; | ||
4780 | |||
4781 | UUID landGroup = landdata.GroupID; | ||
4782 | if(landGroup == UUID.Zero) | ||
4783 | return false; | ||
4784 | |||
4785 | if(landGroup == m_host.GroupID) | ||
4786 | return true; | ||
4787 | |||
4788 | return false; | ||
4789 | } | ||
4790 | |||
4759 | /// <summary> | 4791 | /// <summary> |
4760 | /// teleports a object (full linkset) | 4792 | /// teleports a object (full linkset) |
4761 | /// </summary> | 4793 | /// </summary> |
@@ -4785,9 +4817,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4785 | } | 4817 | } |
4786 | 4818 | ||
4787 | SceneObjectGroup sog = World.GetSceneObjectGroup(objUUID); | 4819 | SceneObjectGroup sog = World.GetSceneObjectGroup(objUUID); |
4788 | if(sog== null || sog.IsDeleted) | 4820 | if(sog== null || sog.IsDeleted || sog.inTransit) |
4789 | return -1; | 4821 | return -1; |
4790 | 4822 | ||
4823 | if(sog.OwnerID != m_host.OwnerID) | ||
4824 | { | ||
4825 | Vector3 pos = sog.AbsolutePosition; | ||
4826 | if(!checkAllowObjectTPbyLandOwner(pos)) | ||
4827 | return -1; | ||
4828 | } | ||
4829 | |||
4791 | UUID myid = m_host.ParentGroup.UUID; | 4830 | UUID myid = m_host.ParentGroup.UUID; |
4792 | 4831 | ||
4793 | return sog.TeleportObject(myid, targetPos, rotation, flags); | 4832 | return sog.TeleportObject(myid, targetPos, rotation, flags); |