From c568d4c16b75615dd10b253cad5cd2fd710e2fb9 Mon Sep 17 00:00:00 2001 From: onefang Date: Sun, 19 May 2019 22:54:18 +1000 Subject: One last big source of script slowness removed. No need to artificially slow stuff down. lol --- .../Shared/Api/Implementation/OSSL_Api.cs | 37 ++++------------------ 1 file changed, 7 insertions(+), 30 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 2c025c1..d897098 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -139,8 +139,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api internal TaskInventoryItem m_item; internal bool m_OSFunctionsEnabled = false; internal ThreatLevel m_MaxThreatLevel = ThreatLevel.VeryLow; - internal float m_ScriptDelayFactor = 1.0f; - internal float m_ScriptDistanceFactor = 1.0f; internal bool m_debuggerSafe = false; internal Dictionary m_FunctionPerms = new Dictionary(); protected IUrlModule m_UrlModule = null; @@ -161,11 +159,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api // m_log.Warn("[OSSL] OSSL FUNCTIONS ENABLED"); } - m_ScriptDelayFactor = - m_ScriptEngine.Config.GetFloat("ScriptDelayFactor", 1.0f); - m_ScriptDistanceFactor = - m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f); - string risk = m_ScriptEngine.Config.GetString("OSFunctionThreatLevel", "VeryLow"); switch (risk) { @@ -473,13 +466,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api OSSLShoutError(string.Format("Use of function {0} is deprecated. Use {1} instead.", function, replacement)); } - protected void ScriptSleep(int delay) - { - delay = (int)((float)delay * m_ScriptDelayFactor); - if (delay == 0) - return; - System.Threading.Thread.Sleep(delay); - } +//// protected void ScriptSleep(int delay) +//// { +//// delay = (int)((float)delay * m_ScriptDelayFactor); +//// if (delay == 0) +//// return; +//// System.Threading.Thread.Sleep(delay); +//// } public LSL_Integer osSetTerrainHeight(int x, int y, double val) { @@ -881,17 +874,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Vector3 pos = presence.AbsolutePosition; if(!checkAllowAgentTPbyLandOwner(agentId, pos)) - { - ScriptSleep(500); return; - } if(regionName == World.RegionInfo.RegionName) { // should be faster than going to threadpool World.RequestTeleportLocation(presence.ControllingClient, regionName, position, lookat, (uint)TPFlags.ViaLocation); - ScriptSleep(500); } else { @@ -902,7 +891,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api presence.ControllingClient, regionName, position, lookat, (uint)TPFlags.ViaLocation), null, "OSSL_Api.TeleportAgentByRegionCoords"); - ScriptSleep(5000); } } } @@ -930,18 +918,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Vector3 pos = presence.AbsolutePosition; if(!checkAllowAgentTPbyLandOwner(agentId, pos)) - { - ScriptSleep(500); return; - } Util.FireAndForget( o => World.RequestTeleportLocation( presence.ControllingClient, regionHandle, position, lookat, (uint)TPFlags.ViaLocation), null, "OSSL_Api.TeleportAgentByRegionName"); - - ScriptSleep(5000); } } @@ -956,14 +939,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Vector3 pos = presence.AbsolutePosition; if(!checkAllowAgentTPbyLandOwner(agentId, pos)) - { - ScriptSleep(500); return; - } World.RequestTeleportLocation(presence.ControllingClient, World.RegionInfo.RegionName, position, lookat, (uint)TPFlags.ViaLocation); - ScriptSleep(500); } } @@ -3389,8 +3368,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (region != null) key = region.TerrainImage; - ScriptSleep(1000); - return key.ToString(); } -- cgit v1.1