diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
3 files changed, 33 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs index 00a99c3..2f5b526 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs | |||
@@ -147,7 +147,13 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
147 | /// <summary> | 147 | /// <summary> |
148 | /// Stop the script instance. | 148 | /// Stop the script instance. |
149 | /// </summary> | 149 | /// </summary> |
150 | /// <remarks> | ||
151 | /// This must not be called by a thread that is in the process of handling an event for this script. Otherwise | ||
152 | /// there is a danger that it will self-abort and not complete the reset. | ||
153 | /// </remarks> | ||
150 | /// <param name="timeout"></param> | 154 | /// <param name="timeout"></param> |
155 | /// How many milliseconds we will wait for an existing script event to finish before | ||
156 | /// forcibly aborting that event. | ||
151 | /// <returns>true if the script was successfully stopped, false otherwise</returns> | 157 | /// <returns>true if the script was successfully stopped, false otherwise</returns> |
152 | bool Stop(int timeout); | 158 | bool Stop(int timeout); |
153 | 159 | ||
@@ -169,8 +175,31 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
169 | object EventProcessor(); | 175 | object EventProcessor(); |
170 | 176 | ||
171 | int EventTime(); | 177 | int EventTime(); |
172 | void ResetScript(); | 178 | |
179 | /// <summary> | ||
180 | /// Reset the script. | ||
181 | /// </summary> | ||
182 | /// <remarks> | ||
183 | /// This must not be called by a thread that is in the process of handling an event for this script. Otherwise | ||
184 | /// there is a danger that it will self-abort and not complete the reset. Such a thread must call | ||
185 | /// ApiResetScript() instead. | ||
186 | /// </remarks> | ||
187 | /// <param name='timeout'> | ||
188 | /// How many milliseconds we will wait for an existing script event to finish before | ||
189 | /// forcibly aborting that event prior to script reset. | ||
190 | /// </param> | ||
191 | void ResetScript(int timeout); | ||
192 | |||
193 | /// <summary> | ||
194 | /// Reset the script. | ||
195 | /// </summary> | ||
196 | /// <remarks> | ||
197 | /// This must not be called by any thread other than the one executing the scripts current event. This is | ||
198 | /// because there is no wait or abort logic if another thread is in the middle of processing a script event. | ||
199 | /// Such an external thread should use ResetScript() instead. | ||
200 | /// </remarks> | ||
173 | void ApiResetScript(); | 201 | void ApiResetScript(); |
202 | |||
174 | Dictionary<string, object> GetVars(); | 203 | Dictionary<string, object> GetVars(); |
175 | void SetVars(Dictionary<string, object> vars); | 204 | void SetVars(Dictionary<string, object> vars); |
176 | DetectParams GetDetectParams(int idx); | 205 | DetectParams GetDetectParams(int idx); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 68f701c..ff4d130 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -880,7 +880,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
880 | return (DateTime.Now - m_EventStart).Seconds; | 880 | return (DateTime.Now - m_EventStart).Seconds; |
881 | } | 881 | } |
882 | 882 | ||
883 | public void ResetScript() | 883 | public void ResetScript(int timeout) |
884 | { | 884 | { |
885 | if (m_Script == null) | 885 | if (m_Script == null) |
886 | return; | 886 | return; |
@@ -890,7 +890,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
890 | RemoveState(); | 890 | RemoveState(); |
891 | ReleaseControls(); | 891 | ReleaseControls(); |
892 | 892 | ||
893 | Stop(0); | 893 | Stop(timeout); |
894 | SceneObjectPart part = Engine.World.GetSceneObjectPart(LocalID); | 894 | SceneObjectPart part = Engine.World.GetSceneObjectPart(LocalID); |
895 | part.Inventory.GetInventoryItem(ItemID).PermsMask = 0; | 895 | part.Inventory.GetInventoryItem(ItemID).PermsMask = 0; |
896 | part.Inventory.GetInventoryItem(ItemID).PermsGranter = UUID.Zero; | 896 | part.Inventory.GetInventoryItem(ItemID).PermsGranter = UUID.Zero; |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 494e0b6..0bd9a06 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -1783,7 +1783,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1783 | { | 1783 | { |
1784 | IScriptInstance instance = GetInstance(itemID); | 1784 | IScriptInstance instance = GetInstance(itemID); |
1785 | if (instance != null) | 1785 | if (instance != null) |
1786 | instance.ResetScript(); | 1786 | instance.ResetScript(m_WaitForEventCompletionOnScriptStop); |
1787 | } | 1787 | } |
1788 | 1788 | ||
1789 | public void StartScript(UUID itemID) | 1789 | public void StartScript(UUID itemID) |