diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 304848e..bb08d90 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -274,6 +274,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
274 | MainConsole.Instance.Commands.AddCommand( | 274 | MainConsole.Instance.Commands.AddCommand( |
275 | "scripts", false, "show scripts", "show scripts", "Show script information", | 275 | "scripts", false, "show scripts", "show scripts", "Show script information", |
276 | "Synonym for scripts show command", HandleShowScripts); | 276 | "Synonym for scripts show command", HandleShowScripts); |
277 | |||
278 | MainConsole.Instance.Commands.AddCommand( | ||
279 | "scripts", false, "scripts suspend", "scripts suspend", "Suspend all scripts", | ||
280 | "Suspends all currently running scripts. This only suspends event delivery, it will not suspend a" | ||
281 | + " script that is currently processing an event.", | ||
282 | HandleSuspendScripts); | ||
283 | |||
284 | MainConsole.Instance.Commands.AddCommand( | ||
285 | "scripts", false, "scripts resume", "scripts resume", "Resume all scripts", | ||
286 | "Resumes all currently suspended scripts", HandleResumeScripts); | ||
277 | } | 287 | } |
278 | 288 | ||
279 | public void HandleShowScripts(string module, string[] cmdparams) | 289 | public void HandleShowScripts(string module, string[] cmdparams) |
@@ -313,6 +323,44 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
313 | } | 323 | } |
314 | } | 324 | } |
315 | 325 | ||
326 | public void HandleSuspendScripts(string module, string[] cmdparams) | ||
327 | { | ||
328 | lock (m_Scripts) | ||
329 | { | ||
330 | foreach (IScriptInstance instance in m_Scripts.Values) | ||
331 | { | ||
332 | if (!instance.Suspended) | ||
333 | { | ||
334 | instance.Suspend(); | ||
335 | |||
336 | SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID); | ||
337 | MainConsole.Instance.OutputFormat( | ||
338 | "Suspended {0}.{1}, item UUID {2}, prim UUID {3} @ {4}", | ||
339 | instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, sop.AbsolutePosition); | ||
340 | } | ||
341 | } | ||
342 | } | ||
343 | } | ||
344 | |||
345 | public void HandleResumeScripts(string module, string[] cmdparams) | ||
346 | { | ||
347 | lock (m_Scripts) | ||
348 | { | ||
349 | foreach (IScriptInstance instance in m_Scripts.Values) | ||
350 | { | ||
351 | if (instance.Suspended) | ||
352 | { | ||
353 | instance.Resume(); | ||
354 | |||
355 | SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID); | ||
356 | MainConsole.Instance.OutputFormat( | ||
357 | "Resumed {0}.{1}, item UUID {2}, prim UUID {3} @ {4}", | ||
358 | instance.PrimName, instance.ScriptName, instance.ItemID, instance.ObjectID, sop.AbsolutePosition); | ||
359 | } | ||
360 | } | ||
361 | } | ||
362 | } | ||
363 | |||
316 | public void RemoveRegion(Scene scene) | 364 | public void RemoveRegion(Scene scene) |
317 | { | 365 | { |
318 | if (!m_Enabled) | 366 | if (!m_Enabled) |
@@ -841,7 +889,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
841 | 889 | ||
842 | m_log.DebugFormat( | 890 | m_log.DebugFormat( |
843 | "[XEngine] Loaded script {0}.{1}, item UUID {2}, prim UUID {3} @ {4}.{5}", | 891 | "[XEngine] Loaded script {0}.{1}, item UUID {2}, prim UUID {3} @ {4}.{5}", |
844 | part.ParentGroup.RootPart.Name, item.Name, itemID, part.UUID, | 892 | part.ParentGroup.RootPart.Name, item.Name, itemID, part.UUID, |
845 | part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName); | 893 | part.ParentGroup.RootPart.AbsolutePosition, part.ParentGroup.Scene.RegionInfo.RegionName); |
846 | 894 | ||
847 | if (presence != null) | 895 | if (presence != null) |