aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
diff options
context:
space:
mode:
authorOren Hurvitz2015-08-07 16:35:32 +0300
committerOren Hurvitz2015-08-11 08:44:27 +0100
commit59da146e9dd678aea2e0bd3e16ef178c183754a0 (patch)
tree4b6cfebfd3d0a41cc51dcd2eac377ce9cfbe8d2c /OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
parentWhen scripts are sleeping, don't count that as execution time (diff)
downloadopensim-SC-59da146e9dd678aea2e0bd3e16ef178c183754a0.zip
opensim-SC-59da146e9dd678aea2e0bd3e16ef178c183754a0.tar.gz
opensim-SC-59da146e9dd678aea2e0bd3e16ef178c183754a0.tar.bz2
opensim-SC-59da146e9dd678aea2e0bd3e16ef178c183754a0.tar.xz
When the user stops a script, have it remain stopped
Previously the script state was never saved for a !Running script, so upon region restart the script would be Running again. The use of the 'StayStopped' flag is needed because all scripts are automatically stopped when the region shuts down, but in that case we shouldn't save in their state that they're !Running.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine/XEngine.cs')
-rwxr-xr-xOpenSim/Region/ScriptEngine/XEngine/XEngine.cs5
1 files changed, 5 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 5071884..62bf803 100755
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -699,6 +699,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
699 { 699 {
700 if (instance.Running) 700 if (instance.Running)
701 { 701 {
702 instance.StayStopped = true; // the script was stopped explicitly
703
702 instance.Stop(0); 704 instance.Stop(0);
703 705
704 SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID); 706 SceneObjectPart sop = m_Scene.GetSceneObjectPart(instance.ObjectID);
@@ -1914,6 +1916,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1914 1916
1915 if (instance != null) 1917 if (instance != null)
1916 { 1918 {
1919 lock (instance.EventQueue)
1920 instance.StayStopped = true; // the script was stopped explicitly
1921
1917 instance.Stop(m_WaitForEventCompletionOnScriptStop); 1922 instance.Stop(m_WaitForEventCompletionOnScriptStop);
1918 } 1923 }
1919 else 1924 else