aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs32
1 files changed, 15 insertions, 17 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index ce48e63..d665f69 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -854,6 +854,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
854 854
855 private bool checkAllowAgentTPbyLandOwner(UUID agentId, Vector3 pos) 855 private bool checkAllowAgentTPbyLandOwner(UUID agentId, Vector3 pos)
856 { 856 {
857 UUID hostOwner = m_host.OwnerID;
858
859 if(hostOwner == agentId)
860 return true;
861
857 if (m_item.PermsGranter == agentId) 862 if (m_item.PermsGranter == agentId)
858 { 863 {
859 if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0) 864 if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0)
@@ -868,8 +873,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
868 if(landdata == null) 873 if(landdata == null)
869 return true; 874 return true;
870 875
871 UUID hostOwner = m_host.OwnerID;
872
873 if(landdata.OwnerID == hostOwner) 876 if(landdata.OwnerID == hostOwner)
874 return true; 877 return true;
875 878
@@ -896,11 +899,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
896 // 899 //
897 CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent"); 900 CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent");
898 901
899 TeleportAgent(agent, regionName, position, lookat, true); 902 TeleportAgent(agent, regionName, position, lookat);
900 } 903 }
901 904
902 private void TeleportAgent(string agent, string regionName, 905 private void TeleportAgent(string agent, string regionName,
903 LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool isNotOwner) 906 LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
904 { 907 {
905 m_host.AddScriptLPS(1); 908 m_host.AddScriptLPS(1);
906 if(String.IsNullOrEmpty(regionName)) 909 if(String.IsNullOrEmpty(regionName))
@@ -914,7 +917,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
914 return; 917 return;
915 918
916 Vector3 pos = presence.AbsolutePosition; 919 Vector3 pos = presence.AbsolutePosition;
917 if(isNotOwner && !checkAllowAgentTPbyLandOwner(agentId, pos)) 920 if(!checkAllowAgentTPbyLandOwner(agentId, pos))
918 { 921 {
919 ScriptSleep(500); 922 ScriptSleep(500);
920 return; 923 return;
@@ -947,11 +950,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
947 // 950 //
948 CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent"); 951 CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent");
949 952
950 TeleportAgent(agent, regionGridX, regionGridY, position, lookat, true); 953 TeleportAgent(agent, regionGridX, regionGridY, position, lookat);
951 } 954 }
952 955
953 private void TeleportAgent(string agent, int regionGridX, int regionGridY, 956 private void TeleportAgent(string agent, int regionGridX, int regionGridY,
954 LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool isNotOwner) 957 LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
955 { 958 {
956 m_host.AddScriptLPS(1); 959 m_host.AddScriptLPS(1);
957 960
@@ -965,7 +968,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
965 return; 968 return;
966 969
967 Vector3 pos = presence.AbsolutePosition; 970 Vector3 pos = presence.AbsolutePosition;
968 if(isNotOwner && !checkAllowAgentTPbyLandOwner(agentId, pos)) 971 if(!checkAllowAgentTPbyLandOwner(agentId, pos))
969 { 972 {
970 ScriptSleep(500); 973 ScriptSleep(500);
971 return; 974 return;
@@ -983,11 +986,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
983 986
984 public void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 987 public void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
985 { 988 {
986 TeleportAgent(agent, position, lookat, true);
987 }
988
989 private void TeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat, bool isNotOwner)
990 {
991 m_host.AddScriptLPS(1); 989 m_host.AddScriptLPS(1);
992 UUID agentId; 990 UUID agentId;
993 if (UUID.TryParse(agent, out agentId)) 991 if (UUID.TryParse(agent, out agentId))
@@ -997,7 +995,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
997 return; 995 return;
998 996
999 Vector3 pos = presence.AbsolutePosition; 997 Vector3 pos = presence.AbsolutePosition;
1000 if(isNotOwner && !checkAllowAgentTPbyLandOwner(agentId, pos)) 998 if(!checkAllowAgentTPbyLandOwner(agentId, pos))
1001 { 999 {
1002 ScriptSleep(500); 1000 ScriptSleep(500);
1003 return; 1001 return;
@@ -1014,19 +1012,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1014 // Threat level None because this is what can already be done with the World Map in the viewer 1012 // Threat level None because this is what can already be done with the World Map in the viewer
1015 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); 1013 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner");
1016 1014
1017 TeleportAgent(m_host.OwnerID.ToString(), regionName, position, lookat, false); 1015 TeleportAgent(m_host.OwnerID.ToString(), regionName, position, lookat);
1018 } 1016 }
1019 1017
1020 public void osTeleportOwner(int regionGridX, int regionGridY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 1018 public void osTeleportOwner(int regionGridX, int regionGridY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
1021 { 1019 {
1022 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner"); 1020 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner");
1023 1021
1024 TeleportAgent(m_host.OwnerID.ToString(), regionGridX, regionGridY, position, lookat, false); 1022 TeleportAgent(m_host.OwnerID.ToString(), regionGridX, regionGridY, position, lookat);
1025 } 1023 }
1026 1024
1027 public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 1025 public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
1028 { 1026 {
1029 TeleportAgent(m_host.OwnerID.ToString(), position, lookat, false); 1027 osTeleportAgent(m_host.OwnerID.ToString(), position, lookat);
1030 } 1028 }
1031 1029
1032 ///<summary> 1030 ///<summary>