diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 37 |
1 files changed, 7 insertions, 30 deletions
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 | |||
139 | internal TaskInventoryItem m_item; | 139 | internal TaskInventoryItem m_item; |
140 | internal bool m_OSFunctionsEnabled = false; | 140 | internal bool m_OSFunctionsEnabled = false; |
141 | internal ThreatLevel m_MaxThreatLevel = ThreatLevel.VeryLow; | 141 | internal ThreatLevel m_MaxThreatLevel = ThreatLevel.VeryLow; |
142 | internal float m_ScriptDelayFactor = 1.0f; | ||
143 | internal float m_ScriptDistanceFactor = 1.0f; | ||
144 | internal bool m_debuggerSafe = false; | 142 | internal bool m_debuggerSafe = false; |
145 | internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >(); | 143 | internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >(); |
146 | protected IUrlModule m_UrlModule = null; | 144 | protected IUrlModule m_UrlModule = null; |
@@ -161,11 +159,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
161 | // m_log.Warn("[OSSL] OSSL FUNCTIONS ENABLED"); | 159 | // m_log.Warn("[OSSL] OSSL FUNCTIONS ENABLED"); |
162 | } | 160 | } |
163 | 161 | ||
164 | m_ScriptDelayFactor = | ||
165 | m_ScriptEngine.Config.GetFloat("ScriptDelayFactor", 1.0f); | ||
166 | m_ScriptDistanceFactor = | ||
167 | m_ScriptEngine.Config.GetFloat("ScriptDistanceLimitFactor", 1.0f); | ||
168 | |||
169 | string risk = m_ScriptEngine.Config.GetString("OSFunctionThreatLevel", "VeryLow"); | 162 | string risk = m_ScriptEngine.Config.GetString("OSFunctionThreatLevel", "VeryLow"); |
170 | switch (risk) | 163 | switch (risk) |
171 | { | 164 | { |
@@ -473,13 +466,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
473 | OSSLShoutError(string.Format("Use of function {0} is deprecated. Use {1} instead.", function, replacement)); | 466 | OSSLShoutError(string.Format("Use of function {0} is deprecated. Use {1} instead.", function, replacement)); |
474 | } | 467 | } |
475 | 468 | ||
476 | protected void ScriptSleep(int delay) | 469 | //// protected void ScriptSleep(int delay) |
477 | { | 470 | //// { |
478 | delay = (int)((float)delay * m_ScriptDelayFactor); | 471 | //// delay = (int)((float)delay * m_ScriptDelayFactor); |
479 | if (delay == 0) | 472 | //// if (delay == 0) |
480 | return; | 473 | //// return; |
481 | System.Threading.Thread.Sleep(delay); | 474 | //// System.Threading.Thread.Sleep(delay); |
482 | } | 475 | //// } |
483 | 476 | ||
484 | public LSL_Integer osSetTerrainHeight(int x, int y, double val) | 477 | public LSL_Integer osSetTerrainHeight(int x, int y, double val) |
485 | { | 478 | { |
@@ -881,17 +874,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
881 | 874 | ||
882 | Vector3 pos = presence.AbsolutePosition; | 875 | Vector3 pos = presence.AbsolutePosition; |
883 | if(!checkAllowAgentTPbyLandOwner(agentId, pos)) | 876 | if(!checkAllowAgentTPbyLandOwner(agentId, pos)) |
884 | { | ||
885 | ScriptSleep(500); | ||
886 | return; | 877 | return; |
887 | } | ||
888 | 878 | ||
889 | if(regionName == World.RegionInfo.RegionName) | 879 | if(regionName == World.RegionInfo.RegionName) |
890 | { | 880 | { |
891 | // should be faster than going to threadpool | 881 | // should be faster than going to threadpool |
892 | World.RequestTeleportLocation(presence.ControllingClient, regionName, position, | 882 | World.RequestTeleportLocation(presence.ControllingClient, regionName, position, |
893 | lookat, (uint)TPFlags.ViaLocation); | 883 | lookat, (uint)TPFlags.ViaLocation); |
894 | ScriptSleep(500); | ||
895 | } | 884 | } |
896 | else | 885 | else |
897 | { | 886 | { |
@@ -902,7 +891,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
902 | presence.ControllingClient, regionName, position, | 891 | presence.ControllingClient, regionName, position, |
903 | lookat, (uint)TPFlags.ViaLocation), | 892 | lookat, (uint)TPFlags.ViaLocation), |
904 | null, "OSSL_Api.TeleportAgentByRegionCoords"); | 893 | null, "OSSL_Api.TeleportAgentByRegionCoords"); |
905 | ScriptSleep(5000); | ||
906 | } | 894 | } |
907 | } | 895 | } |
908 | } | 896 | } |
@@ -930,18 +918,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
930 | 918 | ||
931 | Vector3 pos = presence.AbsolutePosition; | 919 | Vector3 pos = presence.AbsolutePosition; |
932 | if(!checkAllowAgentTPbyLandOwner(agentId, pos)) | 920 | if(!checkAllowAgentTPbyLandOwner(agentId, pos)) |
933 | { | ||
934 | ScriptSleep(500); | ||
935 | return; | 921 | return; |
936 | } | ||
937 | 922 | ||
938 | Util.FireAndForget( | 923 | Util.FireAndForget( |
939 | o => World.RequestTeleportLocation( | 924 | o => World.RequestTeleportLocation( |
940 | presence.ControllingClient, regionHandle, | 925 | presence.ControllingClient, regionHandle, |
941 | position, lookat, (uint)TPFlags.ViaLocation), | 926 | position, lookat, (uint)TPFlags.ViaLocation), |
942 | null, "OSSL_Api.TeleportAgentByRegionName"); | 927 | null, "OSSL_Api.TeleportAgentByRegionName"); |
943 | |||
944 | ScriptSleep(5000); | ||
945 | } | 928 | } |
946 | } | 929 | } |
947 | 930 | ||
@@ -956,14 +939,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
956 | 939 | ||
957 | Vector3 pos = presence.AbsolutePosition; | 940 | Vector3 pos = presence.AbsolutePosition; |
958 | if(!checkAllowAgentTPbyLandOwner(agentId, pos)) | 941 | if(!checkAllowAgentTPbyLandOwner(agentId, pos)) |
959 | { | ||
960 | ScriptSleep(500); | ||
961 | return; | 942 | return; |
962 | } | ||
963 | 943 | ||
964 | World.RequestTeleportLocation(presence.ControllingClient, World.RegionInfo.RegionName, position, | 944 | World.RequestTeleportLocation(presence.ControllingClient, World.RegionInfo.RegionName, position, |
965 | lookat, (uint)TPFlags.ViaLocation); | 945 | lookat, (uint)TPFlags.ViaLocation); |
966 | ScriptSleep(500); | ||
967 | } | 946 | } |
968 | } | 947 | } |
969 | 948 | ||
@@ -3389,8 +3368,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3389 | if (region != null) | 3368 | if (region != null) |
3390 | key = region.TerrainImage; | 3369 | key = region.TerrainImage; |
3391 | 3370 | ||
3392 | ScriptSleep(1000); | ||
3393 | |||
3394 | return key.ToString(); | 3371 | return key.ToString(); |
3395 | } | 3372 | } |
3396 | 3373 | ||