From 0c3061f973417ecce8f412c82139cfad82504921 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Tue, 28 Aug 2012 03:40:27 +0100 Subject: [PATCH] implementing rule tracking --- .../Shared/Api/Implementation/LSL_Api.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 709cac2743..ae92716b8a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -7234,9 +7234,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api List parts = GetLinkParts(linknumber); LSL_List remaining = null; + uint rulesParsed = 0; foreach (SceneObjectPart part in parts) - remaining = SetPrimParams(part, rules, originFunc); + remaining = SetPrimParams(part, rules, originFunc, ref rulesParsed); while (remaining != null && remaining.Length > 2) { @@ -7245,11 +7246,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api parts = GetLinkParts(linknumber); foreach (SceneObjectPart part in parts) - remaining = SetPrimParams(part, rules, originFunc); + remaining = SetPrimParams(part, rules, originFunc, ref rulesParsed); } } - protected LSL_List SetPrimParams(SceneObjectPart part, LSL_List rules, string originFunc) + protected LSL_List SetPrimParams(SceneObjectPart part, LSL_List rules, string originFunc, ref uint rulesParsed) { int idx = 0; int idxStart = 0; @@ -7261,6 +7262,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { while (idx < rules.Length) { + ++rulesParsed; int code = rules.GetLSLIntegerItem(idx++); int remain = rules.Length - idx; @@ -7643,7 +7645,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { ShoutError(string.Format( "{0} error running rule #{1}: arg #{2} ", - originFunc, "unknown", idx - idxStart) + e.Message); + originFunc, rulesParsed, idx - idxStart) + e.Message); } finally { @@ -10774,14 +10776,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (obj.OwnerID != m_host.OwnerID) return; - LSL_List remaining = SetPrimParams(obj, rules, originFunc); + uint rulesParsed = 0; + LSL_List remaining = SetPrimParams(obj, rules, originFunc, ref rulesParsed); while ((object)remaining != null && remaining.Length > 2) { LSL_Integer newLink = remaining.GetLSLIntegerItem(0); LSL_List newrules = remaining.GetSublist(1, -1); foreach(SceneObjectPart part in GetLinkParts(obj, newLink)){ - remaining = SetPrimParams(part, newrules, originFunc); + remaining = SetPrimParams(part, newrules, originFunc, ref rulesParsed); } } }