diff options
author | Melanie Thielker | 2008-09-26 16:37:29 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-26 16:37:29 +0000 |
commit | e8d1235e91e336ebbb4f77cdffd9c19bb36eb078 (patch) | |
tree | e927c21004ec78f2b6459e6fca675af62761ca2e /OpenSim | |
parent | Pluggable API module (XEngine style) support for DNE (diff) | |
download | opensim-SC-e8d1235e91e336ebbb4f77cdffd9c19bb36eb078.zip opensim-SC-e8d1235e91e336ebbb4f77cdffd9c19bb36eb078.tar.gz opensim-SC-e8d1235e91e336ebbb4f77cdffd9c19bb36eb078.tar.bz2 opensim-SC-e8d1235e91e336ebbb4f77cdffd9c19bb36eb078.tar.xz |
Adds support for the "Running" checkbox and the "Reset" button, as well as
ResetScripts In Selection, Set Script to [not] Running In Selection from
the tools menu. Allows DNE script reset without a full recompile.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs index a2b5621..71db4ee 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs | |||
@@ -31,6 +31,7 @@ using System.Reflection; | |||
31 | using log4net; | 31 | using log4net; |
32 | using Nini.Config; | 32 | using Nini.Config; |
33 | using OpenSim.Region.Interfaces; | 33 | using OpenSim.Region.Interfaces; |
34 | using OpenSim.Framework; | ||
34 | using OpenSim.Region.Environment.Interfaces; | 35 | using OpenSim.Region.Environment.Interfaces; |
35 | using OpenSim.Region.Environment.Scenes; | 36 | using OpenSim.Region.Environment.Scenes; |
36 | using OpenSim.Region.ScriptEngine.Interfaces; | 37 | using OpenSim.Region.ScriptEngine.Interfaces; |
@@ -135,6 +136,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
135 | 136 | ||
136 | m_EventManager.HookUpEvents(); | 137 | m_EventManager.HookUpEvents(); |
137 | 138 | ||
139 | m_Scene.EventManager.OnScriptReset += OnScriptReset; | ||
140 | m_Scene.EventManager.OnGetScriptRunning += OnGetScriptRunning; | ||
141 | m_Scene.EventManager.OnStartScript += OnStartScript; | ||
142 | m_Scene.EventManager.OnStopScript += OnStopScript; | ||
143 | |||
138 | m_ScriptManager.Start(); | 144 | m_ScriptManager.Start(); |
139 | } | 145 | } |
140 | 146 | ||
@@ -310,5 +316,43 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
310 | 316 | ||
311 | m_ScriptManager.ResetScript(localID, itemID); | 317 | m_ScriptManager.ResetScript(localID, itemID); |
312 | } | 318 | } |
319 | |||
320 | public void OnScriptReset(uint localID, UUID itemID) | ||
321 | { | ||
322 | ResetScript(itemID); | ||
323 | } | ||
324 | |||
325 | public void OnStartScript(uint localID, UUID itemID) | ||
326 | { | ||
327 | InstanceData id = m_ScriptManager.GetScript(localID, itemID); | ||
328 | if (id == null) | ||
329 | return; | ||
330 | |||
331 | if (!id.Disabled) | ||
332 | id.Running = true; | ||
333 | } | ||
334 | |||
335 | public void OnStopScript(uint localID, UUID itemID) | ||
336 | { | ||
337 | InstanceData id = m_ScriptManager.GetScript(localID, itemID); | ||
338 | if (id == null) | ||
339 | return; | ||
340 | |||
341 | id.Running = false; | ||
342 | } | ||
343 | |||
344 | public void OnGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) | ||
345 | { | ||
346 | uint localID = m_ScriptManager.GetLocalID(itemID); | ||
347 | if (localID == 0) | ||
348 | return; | ||
349 | |||
350 | InstanceData id = m_ScriptManager.GetScript(localID, itemID); | ||
351 | if (id == null) | ||
352 | return; | ||
353 | |||
354 | controllingClient.SendScriptRunningReply(objectID, itemID, | ||
355 | id.Running); | ||
356 | } | ||
313 | } | 357 | } |
314 | } | 358 | } |