diff options
author | BlueWall | 2012-06-23 04:11:31 -0400 |
---|---|---|
committer | BlueWall | 2012-06-23 04:15:14 -0400 |
commit | 6d3ee8bb39d47ed7b32e8905fa0b2fc31c5a9f80 (patch) | |
tree | 355fc7f7b91c55f7de9a90f2bd12d4fa2cd91e0d /OpenSim/Region/Framework | |
parent | Resolve various race conditions between accessing and removing external scrip... (diff) | |
download | opensim-SC_OLD-6d3ee8bb39d47ed7b32e8905fa0b2fc31c5a9f80.zip opensim-SC_OLD-6d3ee8bb39d47ed7b32e8905fa0b2fc31c5a9f80.tar.gz opensim-SC_OLD-6d3ee8bb39d47ed7b32e8905fa0b2fc31c5a9f80.tar.bz2 opensim-SC_OLD-6d3ee8bb39d47ed7b32e8905fa0b2fc31c5a9f80.tar.xz |
Fix script "Running" behavior
Unchecking "Running" box in script editor now persists. This fixes http://opensimulator.org/mantis/view.php?id=6057
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IScriptModule.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs index 0d488df..cbaf241 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs | |||
@@ -75,6 +75,8 @@ namespace OpenSim.Region.Framework.Interfaces | |||
75 | /// <param name="itemID">The item ID of the script.</param> | 75 | /// <param name="itemID">The item ID of the script.</param> |
76 | bool GetScriptState(UUID itemID); | 76 | bool GetScriptState(UUID itemID); |
77 | 77 | ||
78 | void SetRunEnable(UUID instanceID, bool enable); | ||
79 | |||
78 | void SaveAllState(); | 80 | void SaveAllState(); |
79 | 81 | ||
80 | /// <summary> | 82 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index e413281..9ff8467 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -2143,10 +2143,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
2143 | if (part == null) | 2143 | if (part == null) |
2144 | return; | 2144 | return; |
2145 | 2145 | ||
2146 | IScriptModule[] engines = RequestModuleInterfaces<IScriptModule>(); | ||
2147 | |||
2146 | if (running) | 2148 | if (running) |
2149 | { | ||
2150 | foreach (IScriptModule engine in engines) | ||
2151 | { | ||
2152 | engine.SetRunEnable(itemID, true); | ||
2153 | } | ||
2147 | EventManager.TriggerStartScript(part.LocalId, itemID); | 2154 | EventManager.TriggerStartScript(part.LocalId, itemID); |
2155 | } | ||
2148 | else | 2156 | else |
2157 | { | ||
2158 | foreach (IScriptModule engine in engines) | ||
2159 | { | ||
2160 | engine.SetRunEnable(itemID, false); | ||
2161 | } | ||
2149 | EventManager.TriggerStopScript(part.LocalId, itemID); | 2162 | EventManager.TriggerStopScript(part.LocalId, itemID); |
2163 | } | ||
2150 | } | 2164 | } |
2151 | 2165 | ||
2152 | public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) | 2166 | public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) |