From 43173f1b0d80eee8589b9e506a5fdb5cfe92cc06 Mon Sep 17 00:00:00 2001
From: nebadon
Date: Sat, 14 Jan 2012 18:36:46 -0700
Subject: commented out redundant land owner checks for osTeleportAgent there
 is no need for these checks just use Allow_osTeleportAgent = PARCEL_OWNER
 also increased function to severe threat level to make it harder to
 accidently enable it for everyone.

---
 .../Shared/Api/Implementation/OSSL_Api.cs          | 38 ++++++++++++++--------
 1 file changed, 24 insertions(+), 14 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 40d9d6f..fc478ab 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -739,7 +739,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
         {
             // High because there is no security check. High griefer potential
             //
-            CheckThreatLevel(ThreatLevel.High, "osTeleportAgent");
+            CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent");
 
             TeleportAgent(agent, regionName, position, lookat, false);
         }
@@ -756,11 +756,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
                 {
                     // For osTeleportAgent, agent must be over owners land to avoid abuse
                     // For osTeleportOwner, this restriction isn't necessary
-                    if (relaxRestrictions ||
-                        m_host.OwnerID
-                        == World.LandChannel.GetLandObject(
-                            presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
-                    {
+
+                    // commented out because its redundant and uneeded please remove eventually.
+                    // if (relaxRestrictions ||
+                    //    m_host.OwnerID
+                    //    == World.LandChannel.GetLandObject(
+                    //        presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
+                    // {
+
                         // We will launch the teleport on a new thread so that when the script threads are terminated
                         // before teleport in ScriptInstance.GetXMLState(), we don't end up aborting the one doing the teleporting.                        
                         Util.FireAndForget(
@@ -769,7 +772,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
                                 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation));
 
                         ScriptSleep(5000);
-                    }
+
+                    // }
+
                 }
             }
         }
@@ -778,7 +783,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
         {
             // High because there is no security check. High griefer potential
             //
-            CheckThreatLevel(ThreatLevel.High, "osTeleportAgent");
+            CheckThreatLevel(ThreatLevel.Severe, "osTeleportAgent");
 
             TeleportAgent(agent, regionX, regionY, position, lookat, false);
         }
@@ -797,11 +802,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
                 {
                     // For osTeleportAgent, agent must be over owners land to avoid abuse
                     // For osTeleportOwner, this restriction isn't necessary
-                    if (relaxRestrictions ||
-                        m_host.OwnerID
-                        == World.LandChannel.GetLandObject(
-                            presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
-                    {
+
+                    // commented out because its redundant and uneeded please remove eventually.
+                    // if (relaxRestrictions ||
+                    //    m_host.OwnerID
+                    //    == World.LandChannel.GetLandObject(
+                    //        presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
+                    // {
+
                         // We will launch the teleport on a new thread so that when the script threads are terminated
                         // before teleport in ScriptInstance.GetXMLState(), we don't end up aborting the one doing the teleporting.
                         Util.FireAndForget(
@@ -810,7 +818,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
                                 new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation));
 
                         ScriptSleep(5000);
-                    }
+
+                   //  }
+
                 }
             }
         }
-- 
cgit v1.1