diff options
author | Melanie | 2012-07-16 23:31:55 +0100 |
---|---|---|
committer | Melanie | 2012-07-16 23:31:55 +0100 |
commit | 1c3b0da74a6e662ceebad53c82d38ba8a42795b3 (patch) | |
tree | 667cc0f0139c4aa91fed19d83c037713293526d0 /OpenSim/Region | |
parent | sending more user-friendly messages to the script error window rather than th... (diff) | |
download | opensim-SC_OLD-1c3b0da74a6e662ceebad53c82d38ba8a42795b3.zip opensim-SC_OLD-1c3b0da74a6e662ceebad53c82d38ba8a42795b3.tar.gz opensim-SC_OLD-1c3b0da74a6e662ceebad53c82d38ba8a42795b3.tar.bz2 opensim-SC_OLD-1c3b0da74a6e662ceebad53c82d38ba8a42795b3.tar.xz |
Revert "Fix script "Running" behavior"
A better solution using the already present flags must be found.
This reverts commit 6d3ee8bb39d47ed7b32e8905fa0b2fc31c5a9f80.
Diffstat (limited to 'OpenSim/Region')
6 files changed, 0 insertions, 53 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs index 42dbedc..143af48 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs | |||
@@ -77,8 +77,6 @@ namespace OpenSim.Region.Framework.Interfaces | |||
77 | /// <param name="itemID">The item ID of the script.</param> | 77 | /// <param name="itemID">The item ID of the script.</param> |
78 | bool GetScriptState(UUID itemID); | 78 | bool GetScriptState(UUID itemID); |
79 | 79 | ||
80 | void SetRunEnable(UUID instanceID, bool enable); | ||
81 | |||
82 | void SaveAllState(); | 80 | void SaveAllState(); |
83 | 81 | ||
84 | /// <summary> | 82 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 9ff8467..e413281 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -2143,24 +2143,10 @@ 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 | |||
2148 | if (running) | 2146 | if (running) |
2149 | { | ||
2150 | foreach (IScriptModule engine in engines) | ||
2151 | { | ||
2152 | engine.SetRunEnable(itemID, true); | ||
2153 | } | ||
2154 | EventManager.TriggerStartScript(part.LocalId, itemID); | 2147 | EventManager.TriggerStartScript(part.LocalId, itemID); |
2155 | } | ||
2156 | else | 2148 | else |
2157 | { | ||
2158 | foreach (IScriptModule engine in engines) | ||
2159 | { | ||
2160 | engine.SetRunEnable(itemID, false); | ||
2161 | } | ||
2162 | EventManager.TriggerStopScript(part.LocalId, itemID); | 2149 | EventManager.TriggerStopScript(part.LocalId, itemID); |
2163 | } | ||
2164 | } | 2150 | } |
2165 | 2151 | ||
2166 | public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) | 2152 | public void GetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) |
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs index ec13b6c..b04f6b6 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs | |||
@@ -64,16 +64,6 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
64 | bool Running { get; set; } | 64 | bool Running { get; set; } |
65 | 65 | ||
66 | /// <summary> | 66 | /// <summary> |
67 | /// Gets or sets a value indicating whether this | ||
68 | /// <see cref="OpenSim.Region.ScriptEngine.Interfaces.IScriptInstance"/> is run. | ||
69 | /// For viewer script editor control | ||
70 | /// </summary> | ||
71 | /// <value> | ||
72 | /// <c>true</c> if run; otherwise, <c>false</c>. | ||
73 | /// </value> | ||
74 | bool Run { get; set; } | ||
75 | |||
76 | /// <summary> | ||
77 | /// Is the script suspended? | 67 | /// Is the script suspended? |
78 | /// </summary> | 68 | /// </summary> |
79 | bool Suspended { get; set; } | 69 | bool Suspended { get; set; } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index f1abd4b..d570ef7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -121,8 +121,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
121 | 121 | ||
122 | public bool Running { get; set; } | 122 | public bool Running { get; set; } |
123 | 123 | ||
124 | public bool Run { get; set; } | ||
125 | |||
126 | public bool Suspended | 124 | public bool Suspended |
127 | { | 125 | { |
128 | get { return m_Suspended; } | 126 | get { return m_Suspended; } |
@@ -218,7 +216,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
218 | m_postOnRez = postOnRez; | 216 | m_postOnRez = postOnRez; |
219 | m_AttachedAvatar = part.ParentGroup.AttachedAvatar; | 217 | m_AttachedAvatar = part.ParentGroup.AttachedAvatar; |
220 | m_RegionID = part.ParentGroup.Scene.RegionInfo.RegionID; | 218 | m_RegionID = part.ParentGroup.Scene.RegionInfo.RegionID; |
221 | Run = true; | ||
222 | 219 | ||
223 | if (part != null) | 220 | if (part != null) |
224 | { | 221 | { |
@@ -360,9 +357,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
360 | 357 | ||
361 | if (m_startedFromSavedState) | 358 | if (m_startedFromSavedState) |
362 | { | 359 | { |
363 | if (!Run) | ||
364 | return; | ||
365 | |||
366 | Start(); | 360 | Start(); |
367 | if (m_postOnRez) | 361 | if (m_postOnRez) |
368 | { | 362 | { |
@@ -395,9 +389,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
395 | } | 389 | } |
396 | else | 390 | else |
397 | { | 391 | { |
398 | if (!Run) | ||
399 | return; | ||
400 | |||
401 | Start(); | 392 | Start(); |
402 | PostEvent(new EventParams("state_entry", | 393 | PostEvent(new EventParams("state_entry", |
403 | new Object[0], new DetectParams[0])); | 394 | new Object[0], new DetectParams[0])); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs index 797bce3..bcdc7bf 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs | |||
@@ -55,7 +55,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
55 | public static string Serialize(ScriptInstance instance) | 55 | public static string Serialize(ScriptInstance instance) |
56 | { | 56 | { |
57 | bool running = instance.Running; | 57 | bool running = instance.Running; |
58 | bool enabled = instance.Run; | ||
59 | 58 | ||
60 | XmlDocument xmldoc = new XmlDocument(); | 59 | XmlDocument xmldoc = new XmlDocument(); |
61 | 60 | ||
@@ -78,12 +77,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
78 | 77 | ||
79 | rootElement.AppendChild(run); | 78 | rootElement.AppendChild(run); |
80 | 79 | ||
81 | XmlElement run_enable = xmldoc.CreateElement("", "Run", ""); | ||
82 | run_enable.AppendChild(xmldoc.CreateTextNode( | ||
83 | enabled.ToString())); | ||
84 | |||
85 | rootElement.AppendChild(run_enable); | ||
86 | |||
87 | Dictionary<string, Object> vars = instance.GetVars(); | 80 | Dictionary<string, Object> vars = instance.GetVars(); |
88 | 81 | ||
89 | XmlElement variables = xmldoc.CreateElement("", "Variables", ""); | 82 | XmlElement variables = xmldoc.CreateElement("", "Variables", ""); |
@@ -232,7 +225,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
232 | { | 225 | { |
233 | object varValue; | 226 | object varValue; |
234 | XmlNodeList partL = rootNode.ChildNodes; | 227 | XmlNodeList partL = rootNode.ChildNodes; |
235 | instance.Run = true; | ||
236 | 228 | ||
237 | foreach (XmlNode part in partL) | 229 | foreach (XmlNode part in partL) |
238 | { | 230 | { |
@@ -244,9 +236,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
244 | case "Running": | 236 | case "Running": |
245 | instance.Running=bool.Parse(part.InnerText); | 237 | instance.Running=bool.Parse(part.InnerText); |
246 | break; | 238 | break; |
247 | case "Run": | ||
248 | instance.Run = bool.Parse(part.InnerText); | ||
249 | break; | ||
250 | case "Variables": | 239 | case "Variables": |
251 | XmlNodeList varL = part.ChildNodes; | 240 | XmlNodeList varL = part.ChildNodes; |
252 | foreach (XmlNode var in varL) | 241 | foreach (XmlNode var in varL) |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 20fad05..01aebb6 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -1541,13 +1541,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1541 | } | 1541 | } |
1542 | } | 1542 | } |
1543 | 1543 | ||
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) | 1544 | public bool GetScriptState(UUID itemID) |
1552 | { | 1545 | { |
1553 | IScriptInstance instance = GetInstance(itemID); | 1546 | IScriptInstance instance = GetInstance(itemID); |