diff options
author | SignpostMarv | 2012-08-28 03:40:27 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-08-29 02:10:04 +0100 |
commit | 0c3061f973417ecce8f412c82139cfad82504921 (patch) | |
tree | 071cbae6063e7d413debcef744ed4b7cd9158594 | |
parent | track originating IScriptApi method for SL-like error messages. Will add rule... (diff) | |
download | opensim-SC-0c3061f973417ecce8f412c82139cfad82504921.zip opensim-SC-0c3061f973417ecce8f412c82139cfad82504921.tar.gz opensim-SC-0c3061f973417ecce8f412c82139cfad82504921.tar.bz2 opensim-SC-0c3061f973417ecce8f412c82139cfad82504921.tar.xz |
implementing rule tracking
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 15 |
1 files 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 709cac2..ae92716 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 | |||
7234 | List<SceneObjectPart> parts = GetLinkParts(linknumber); | 7234 | List<SceneObjectPart> parts = GetLinkParts(linknumber); |
7235 | 7235 | ||
7236 | LSL_List remaining = null; | 7236 | LSL_List remaining = null; |
7237 | uint rulesParsed = 0; | ||
7237 | 7238 | ||
7238 | foreach (SceneObjectPart part in parts) | 7239 | foreach (SceneObjectPart part in parts) |
7239 | remaining = SetPrimParams(part, rules, originFunc); | 7240 | remaining = SetPrimParams(part, rules, originFunc, ref rulesParsed); |
7240 | 7241 | ||
7241 | while (remaining != null && remaining.Length > 2) | 7242 | while (remaining != null && remaining.Length > 2) |
7242 | { | 7243 | { |
@@ -7245,11 +7246,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7245 | parts = GetLinkParts(linknumber); | 7246 | parts = GetLinkParts(linknumber); |
7246 | 7247 | ||
7247 | foreach (SceneObjectPart part in parts) | 7248 | foreach (SceneObjectPart part in parts) |
7248 | remaining = SetPrimParams(part, rules, originFunc); | 7249 | remaining = SetPrimParams(part, rules, originFunc, ref rulesParsed); |
7249 | } | 7250 | } |
7250 | } | 7251 | } |
7251 | 7252 | ||
7252 | protected LSL_List SetPrimParams(SceneObjectPart part, LSL_List rules, string originFunc) | 7253 | protected LSL_List SetPrimParams(SceneObjectPart part, LSL_List rules, string originFunc, ref uint rulesParsed) |
7253 | { | 7254 | { |
7254 | int idx = 0; | 7255 | int idx = 0; |
7255 | int idxStart = 0; | 7256 | int idxStart = 0; |
@@ -7261,6 +7262,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7261 | { | 7262 | { |
7262 | while (idx < rules.Length) | 7263 | while (idx < rules.Length) |
7263 | { | 7264 | { |
7265 | ++rulesParsed; | ||
7264 | int code = rules.GetLSLIntegerItem(idx++); | 7266 | int code = rules.GetLSLIntegerItem(idx++); |
7265 | 7267 | ||
7266 | int remain = rules.Length - idx; | 7268 | int remain = rules.Length - idx; |
@@ -7643,7 +7645,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7643 | { | 7645 | { |
7644 | ShoutError(string.Format( | 7646 | ShoutError(string.Format( |
7645 | "{0} error running rule #{1}: arg #{2} ", | 7647 | "{0} error running rule #{1}: arg #{2} ", |
7646 | originFunc, "unknown", idx - idxStart) + e.Message); | 7648 | originFunc, rulesParsed, idx - idxStart) + e.Message); |
7647 | } | 7649 | } |
7648 | finally | 7650 | finally |
7649 | { | 7651 | { |
@@ -10774,14 +10776,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10774 | if (obj.OwnerID != m_host.OwnerID) | 10776 | if (obj.OwnerID != m_host.OwnerID) |
10775 | return; | 10777 | return; |
10776 | 10778 | ||
10777 | LSL_List remaining = SetPrimParams(obj, rules, originFunc); | 10779 | uint rulesParsed = 0; |
10780 | LSL_List remaining = SetPrimParams(obj, rules, originFunc, ref rulesParsed); | ||
10778 | 10781 | ||
10779 | while ((object)remaining != null && remaining.Length > 2) | 10782 | while ((object)remaining != null && remaining.Length > 2) |
10780 | { | 10783 | { |
10781 | LSL_Integer newLink = remaining.GetLSLIntegerItem(0); | 10784 | LSL_Integer newLink = remaining.GetLSLIntegerItem(0); |
10782 | LSL_List newrules = remaining.GetSublist(1, -1); | 10785 | LSL_List newrules = remaining.GetSublist(1, -1); |
10783 | foreach(SceneObjectPart part in GetLinkParts(obj, newLink)){ | 10786 | foreach(SceneObjectPart part in GetLinkParts(obj, newLink)){ |
10784 | remaining = SetPrimParams(part, newrules, originFunc); | 10787 | remaining = SetPrimParams(part, newrules, originFunc, ref rulesParsed); |
10785 | } | 10788 | } |
10786 | } | 10789 | } |
10787 | } | 10790 | } |