From 5709bed548aa4897d84bb616a2c344e158fe89ff Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 21 Jun 2012 02:09:14 +0100 Subject: Add state file location to errors logged when there's some issue with retrieving state (e.g. exceeds memory limit) --- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 329e361..b8bcb35 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -331,15 +331,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance else { m_log.ErrorFormat( - "[SCRIPT INSTANCE]: Unable to load script state from assembly {0}: Memory limit exceeded", - assembly); + "[SCRIPT INSTANCE]: Unable to load script state file {0} from assembly {1}: Memory limit exceeded", + savedState, assembly); } } catch (Exception e) { m_log.ErrorFormat( - "[SCRIPT INSTANCE]: Unable to load script state from assembly {0}. XML is {1}. Exception {2}{3}", - assembly, xml, e.Message, e.StackTrace); + "[SCRIPT INSTANCE]: Unable to load script state file {0} from assembly {1}. XML is {2}. Exception {3}{4}", + savedState, assembly, xml, e.Message, e.StackTrace); } } // else -- cgit v1.1 From afcabf5244415f2d78391cb03269dc9979b5b3d2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 21 Jun 2012 02:13:03 +0100 Subject: Retrigger build - last jenkins run was glitched --- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index b8bcb35..8c53b1f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -354,7 +354,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance public void Init() { - if (!m_startOnInit) return; + if (!m_startOnInit) + return; if (m_startedFromSavedState) { -- cgit v1.1 From d24122b706cb3ec4ac9c8d1efc30e511a07e1aa7 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 21 Jun 2012 02:24:44 +0100 Subject: Add item id, name, prim name and id to log message when state exists but loading fails. Drop logging about memory limit exceeded to warn from error --- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 8c53b1f..5dfe58e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -330,16 +330,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance } else { - m_log.ErrorFormat( - "[SCRIPT INSTANCE]: Unable to load script state file {0} from assembly {1}: Memory limit exceeded", - savedState, assembly); + m_log.WarnFormat( + "[SCRIPT INSTANCE]: Unable to load script state file {0} for script {1} {2} in {3} {4} (assembly {5}). Memory limit exceeded", + savedState, ScriptName, ItemID, PrimName, ObjectID, assembly); } } catch (Exception e) { m_log.ErrorFormat( - "[SCRIPT INSTANCE]: Unable to load script state file {0} from assembly {1}. XML is {2}. Exception {3}{4}", - savedState, assembly, xml, e.Message, e.StackTrace); + "[SCRIPT INSTANCE]: Unable to load script state file {0} for script {1} {2} in {3} {4} (assembly {5}). XML is {6}. Exception {7}{8}", + savedState, ScriptName, ItemID, PrimName, ObjectID, assembly, xml, e.Message, e.StackTrace); } } // else -- cgit v1.1 From 6d3ee8bb39d47ed7b32e8905fa0b2fc31c5a9f80 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Sat, 23 Jun 2012 04:11:31 -0400 Subject: Fix script "Running" behavior Unchecking "Running" box in script editor now persists. This fixes http://opensimulator.org/mantis/view.php?id=6057 --- OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 9 +++++++++ .../Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs | 11 +++++++++++ 2 files changed, 20 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 5dfe58e..306090e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -120,6 +120,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance public bool Running { get; set; } + public bool Run { get; set; } + public bool Suspended { get { return m_Suspended; } @@ -215,6 +217,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance m_postOnRez = postOnRez; m_AttachedAvatar = part.ParentGroup.AttachedAvatar; m_RegionID = part.ParentGroup.Scene.RegionInfo.RegionID; + Run = true; if (part != null) { @@ -359,6 +362,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance if (m_startedFromSavedState) { + if (!Run) + return; + Start(); if (m_postOnRez) { @@ -391,6 +397,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance } else { + if (!Run) + return; + Start(); PostEvent(new EventParams("state_entry", 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 bcdc7bf..797bce3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptSerializer.cs @@ -55,6 +55,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance public static string Serialize(ScriptInstance instance) { bool running = instance.Running; + bool enabled = instance.Run; XmlDocument xmldoc = new XmlDocument(); @@ -77,6 +78,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance rootElement.AppendChild(run); + XmlElement run_enable = xmldoc.CreateElement("", "Run", ""); + run_enable.AppendChild(xmldoc.CreateTextNode( + enabled.ToString())); + + rootElement.AppendChild(run_enable); + Dictionary vars = instance.GetVars(); XmlElement variables = xmldoc.CreateElement("", "Variables", ""); @@ -225,6 +232,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance { object varValue; XmlNodeList partL = rootNode.ChildNodes; + instance.Run = true; foreach (XmlNode part in partL) { @@ -236,6 +244,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance case "Running": instance.Running=bool.Parse(part.InnerText); break; + case "Run": + instance.Run = bool.Parse(part.InnerText); + break; case "Variables": XmlNodeList varL = part.ChildNodes; foreach (XmlNode var in varL) -- cgit v1.1