diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 26a52f2..c939f74 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -66,6 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
66 | internal LLUUID m_itemID; | 66 | internal LLUUID m_itemID; |
67 | internal bool throwErrorOnNotImplemented = true; | 67 | internal bool throwErrorOnNotImplemented = true; |
68 | internal AsyncCommandManager AsyncCommands = null; | 68 | internal AsyncCommandManager AsyncCommands = null; |
69 | internal float m_ScriptDelayFactor = 1.0f; | ||
69 | 70 | ||
70 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID) | 71 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID) |
71 | { | 72 | { |
@@ -74,9 +75,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
74 | m_localID = localID; | 75 | m_localID = localID; |
75 | m_itemID = itemID; | 76 | m_itemID = itemID; |
76 | 77 | ||
78 | IConfigSource config = new IniConfigSource(Application.iniFilePath); | ||
79 | if (config.Configs["XEngine"] == null) | ||
80 | config.AddConfig("XEngine"); | ||
81 | |||
82 | m_ScriptDelayFactor = config.Configs["XEngine"]. | ||
83 | GetFloat("ScriptDelayFactor", 1.0f); | ||
84 | |||
77 | AsyncCommands = (AsyncCommandManager)ScriptEngine.AsyncCommands; | 85 | AsyncCommands = (AsyncCommandManager)ScriptEngine.AsyncCommands; |
78 | } | 86 | } |
79 | 87 | ||
88 | private void ScriptSleep(int delay) | ||
89 | { | ||
90 | delay = (int)((float)delay * m_ScriptDelayFactor); | ||
91 | if (delay == 0) | ||
92 | return; | ||
93 | System.Threading.Thread.Sleep(delay); | ||
94 | } | ||
95 | |||
80 | private DateTime m_timer = DateTime.Now; | 96 | private DateTime m_timer = DateTime.Now; |
81 | private bool m_waitingForScriptAnswer=false; | 97 | private bool m_waitingForScriptAnswer=false; |
82 | 98 | ||
@@ -2142,7 +2158,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2142 | llApplyImpulse(new LSL_Types.Vector3(llvel.X * groupmass, llvel.Y * groupmass, llvel.Z * groupmass), 0); | 2158 | llApplyImpulse(new LSL_Types.Vector3(llvel.X * groupmass, llvel.Y * groupmass, llvel.Z * groupmass), 0); |
2143 | found = true; | 2159 | found = true; |
2144 | //script delay | 2160 | //script delay |
2145 | System.Threading.Thread.Sleep((int)((groupmass * velmag) / 10)); | 2161 | ScriptSleep((int)((groupmass * velmag) / 10)); |
2146 | break; | 2162 | break; |
2147 | } | 2163 | } |
2148 | } | 2164 | } |
@@ -2798,7 +2814,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2798 | parentPrim.GetProperties(client); | 2814 | parentPrim.GetProperties(client); |
2799 | 2815 | ||
2800 | // sleep for 1 second | 2816 | // sleep for 1 second |
2801 | System.Threading.Thread.Sleep(1000); | 2817 | ScriptSleep(1000); |
2802 | 2818 | ||
2803 | } | 2819 | } |
2804 | 2820 | ||