aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine/XEngine.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs23
1 files changed, 16 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 20fad05..7a9c80c 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -108,6 +108,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
108 private bool m_KillTimedOutScripts; 108 private bool m_KillTimedOutScripts;
109 private string m_ScriptEnginesPath = null; 109 private string m_ScriptEnginesPath = null;
110 110
111 private ExpiringCache<UUID, bool> m_runFlags = new ExpiringCache<UUID, bool>();
112
111 /// <summary> 113 /// <summary>
112 /// Is the entire simulator in the process of shutting down? 114 /// Is the entire simulator in the process of shutting down?
113 /// </summary> 115 /// </summary>
@@ -1196,6 +1198,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1196 if (instance != null) 1198 if (instance != null)
1197 instance.Init(); 1199 instance.Init();
1198 1200
1201 bool runIt;
1202 if (m_runFlags.TryGetValue(itemID, out runIt))
1203 {
1204 if (!runIt)
1205 StopScript(itemID);
1206 m_runFlags.Remove(itemID);
1207 }
1208
1199 return true; 1209 return true;
1200 } 1210 }
1201 1211
@@ -1541,13 +1551,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1541 } 1551 }
1542 } 1552 }
1543 1553
1544 public void SetRunEnable(UUID instanceID, bool enable)
1545 {
1546 IScriptInstance instance = GetInstance(instanceID);
1547 if (instance != null)
1548 instance.Run = enable;
1549 }
1550
1551 public bool GetScriptState(UUID itemID) 1554 public bool GetScriptState(UUID itemID)
1552 { 1555 {
1553 IScriptInstance instance = GetInstance(itemID); 1556 IScriptInstance instance = GetInstance(itemID);
@@ -1575,6 +1578,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1575 IScriptInstance instance = GetInstance(itemID); 1578 IScriptInstance instance = GetInstance(itemID);
1576 if (instance != null) 1579 if (instance != null)
1577 instance.Start(); 1580 instance.Start();
1581 else
1582 m_runFlags.AddOrUpdate(itemID, true, 240);
1578 } 1583 }
1579 1584
1580 public void StopScript(UUID itemID) 1585 public void StopScript(UUID itemID)
@@ -1586,6 +1591,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1586 // cause issues on mono 2.6, 2.10 and possibly later where locks are not released properly on abort. 1591 // cause issues on mono 2.6, 2.10 and possibly later where locks are not released properly on abort.
1587 instance.Stop(1000); 1592 instance.Stop(1000);
1588 } 1593 }
1594 else
1595 {
1596 m_runFlags.AddOrUpdate(itemID, false, 240);
1597 }
1589 } 1598 }
1590 1599
1591 public DetectParams GetDetectParams(UUID itemID, int idx) 1600 public DetectParams GetDetectParams(UUID itemID, int idx)