diff options
author | Melanie | 2012-08-29 03:31:13 +0100 |
---|---|---|
committer | Melanie | 2012-08-29 03:31:13 +0100 |
commit | 899337b4a0584ce2371c3bfcc44387d0f090b792 (patch) | |
tree | 3a3e862951a85889c3c5762d6d30b5dd80868864 /OpenSim/Region/ScriptEngine/Shared/Api/Implementation | |
parent | Merge branch 'master' into careminster (diff) | |
parent | implementing rule tracking (diff) | |
download | opensim-SC-899337b4a0584ce2371c3bfcc44387d0f090b792.zip opensim-SC-899337b4a0584ce2371c3bfcc44387d0f090b792.tar.gz opensim-SC-899337b4a0584ce2371c3bfcc44387d0f090b792.tar.bz2 opensim-SC-899337b4a0584ce2371c3bfcc44387d0f090b792.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 46 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 2 |
2 files changed, 33 insertions, 15 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5316d08..61e8a28 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -7701,7 +7701,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7701 | { | 7701 | { |
7702 | m_host.AddScriptLPS(1); | 7702 | m_host.AddScriptLPS(1); |
7703 | 7703 | ||
7704 | setLinkPrimParams(ScriptBaseClass.LINK_THIS, rules); | 7704 | setLinkPrimParams(ScriptBaseClass.LINK_THIS, rules, "llSetPrimitiveParams"); |
7705 | 7705 | ||
7706 | ScriptSleep(200); | 7706 | ScriptSleep(200); |
7707 | } | 7707 | } |
@@ -7710,10 +7710,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7710 | { | 7710 | { |
7711 | m_host.AddScriptLPS(1); | 7711 | m_host.AddScriptLPS(1); |
7712 | 7712 | ||
7713 | setLinkPrimParams(linknumber, rules); | 7713 | setLinkPrimParams(linknumber, rules, "llSetLinkPrimitiveParamsFast"); |
7714 | |||
7715 | ScriptSleep(200); | ||
7714 | } | 7716 | } |
7715 | 7717 | ||
7716 | private void setLinkPrimParams(int linknumber, LSL_List rules) | 7718 | private void setLinkPrimParams(int linknumber, LSL_List rules, string originFunc) |
7717 | { | 7719 | { |
7718 | List<object> parts = new List<object>(); | 7720 | List<object> parts = new List<object>(); |
7719 | List<SceneObjectPart> prims = GetLinkParts(linknumber); | 7721 | List<SceneObjectPart> prims = GetLinkParts(linknumber); |
@@ -7724,15 +7726,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7724 | parts.Add(p); | 7726 | parts.Add(p); |
7725 | 7727 | ||
7726 | LSL_List remaining = null; | 7728 | LSL_List remaining = null; |
7729 | uint rulesParsed = 0; | ||
7727 | 7730 | ||
7728 | if (parts.Count > 0) | 7731 | if (parts.Count > 0) |
7729 | { | 7732 | { |
7730 | foreach (object part in parts) | 7733 | foreach (object part in parts) |
7731 | { | 7734 | { |
7732 | if (part is SceneObjectPart) | 7735 | if (part is SceneObjectPart) |
7733 | remaining = SetPrimParams((SceneObjectPart)part, rules); | 7736 | remaining = SetPrimParams((SceneObjectPart)part, rules, originFunc, ref rulesParsed); |
7734 | else | 7737 | else |
7735 | remaining = SetPrimParams((ScenePresence)part, rules); | 7738 | remaining = SetPrimParams((ScenePresence)part, rules, originFunc, ref rulesParsed); |
7736 | } | 7739 | } |
7737 | 7740 | ||
7738 | while ((object)remaining != null && remaining.Length > 2) | 7741 | while ((object)remaining != null && remaining.Length > 2) |
@@ -7750,9 +7753,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7750 | foreach (object part in parts) | 7753 | foreach (object part in parts) |
7751 | { | 7754 | { |
7752 | if (part is SceneObjectPart) | 7755 | if (part is SceneObjectPart) |
7753 | remaining = SetPrimParams((SceneObjectPart)part, rules); | 7756 | remaining = SetPrimParams((SceneObjectPart)part, rules, originFunc, ref rulesParsed); |
7754 | else | 7757 | else |
7755 | remaining = SetPrimParams((ScenePresence)part, rules); | 7758 | remaining = SetPrimParams((ScenePresence)part, rules, originFunc, ref rulesParsed); |
7756 | } | 7759 | } |
7757 | } | 7760 | } |
7758 | } | 7761 | } |
@@ -7790,6 +7793,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7790 | 7793 | ||
7791 | public void llSetLinkPrimitiveParams(int linknumber, LSL_List rules) | 7794 | public void llSetLinkPrimitiveParams(int linknumber, LSL_List rules) |
7792 | { | 7795 | { |
7796 | setLinkPrimParams(linknumber, rules, "llSetLinkPrimitiveParams"); | ||
7793 | llSetLinkPrimitiveParamsFast(linknumber, rules); | 7797 | llSetLinkPrimitiveParamsFast(linknumber, rules); |
7794 | ScriptSleep(200); | 7798 | ScriptSleep(200); |
7795 | } | 7799 | } |
@@ -7817,12 +7821,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7817 | return new Vector3((float)x, (float)y, (float)z); | 7821 | return new Vector3((float)x, (float)y, (float)z); |
7818 | } | 7822 | } |
7819 | 7823 | ||
7820 | protected LSL_List SetPrimParams(SceneObjectPart part, LSL_List rules) | 7824 | protected LSL_List SetPrimParams(SceneObjectPart part, LSL_List rules, string originFunc, ref uint rulesParsed) |
7821 | { | 7825 | { |
7822 | if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) | 7826 | if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) |
7823 | return null; | 7827 | return null; |
7824 | 7828 | ||
7825 | int idx = 0; | 7829 | int idx = 0; |
7830 | int idxStart = 0; | ||
7826 | 7831 | ||
7827 | SceneObjectGroup parentgrp = part.ParentGroup; | 7832 | SceneObjectGroup parentgrp = part.ParentGroup; |
7828 | 7833 | ||
@@ -7833,9 +7838,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7833 | { | 7838 | { |
7834 | while (idx < rules.Length) | 7839 | while (idx < rules.Length) |
7835 | { | 7840 | { |
7841 | ++rulesParsed; | ||
7836 | int code = rules.GetLSLIntegerItem(idx++); | 7842 | int code = rules.GetLSLIntegerItem(idx++); |
7837 | 7843 | ||
7838 | int remain = rules.Length - idx; | 7844 | int remain = rules.Length - idx; |
7845 | idxStart = idx; | ||
7839 | 7846 | ||
7840 | int face; | 7847 | int face; |
7841 | LSL_Vector v; | 7848 | LSL_Vector v; |
@@ -8243,7 +8250,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8243 | } | 8250 | } |
8244 | catch (InvalidCastException e) | 8251 | catch (InvalidCastException e) |
8245 | { | 8252 | { |
8246 | ShoutError(e.Message); | 8253 | ShoutError(string.Format( |
8254 | "{0} error running rule #{1}: arg #{2} ", | ||
8255 | originFunc, rulesParsed, idx - idxStart) + e.Message); | ||
8247 | } | 8256 | } |
8248 | finally | 8257 | finally |
8249 | { | 8258 | { |
@@ -11660,7 +11669,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11660 | return tid.ToString(); | 11669 | return tid.ToString(); |
11661 | } | 11670 | } |
11662 | 11671 | ||
11663 | public void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules) | 11672 | public void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules, string originFunc) |
11664 | { | 11673 | { |
11665 | SceneObjectPart obj = World.GetSceneObjectPart(new UUID(prim)); | 11674 | SceneObjectPart obj = World.GetSceneObjectPart(new UUID(prim)); |
11666 | if (obj == null) | 11675 | if (obj == null) |
@@ -11669,14 +11678,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
11669 | if (obj.OwnerID != m_host.OwnerID) | 11678 | if (obj.OwnerID != m_host.OwnerID) |
11670 | return; | 11679 | return; |
11671 | 11680 | ||
11672 | LSL_List remaining = SetPrimParams(obj, rules); | 11681 | uint rulesParsed = 0; |
11682 | LSL_List remaining = SetPrimParams(obj, rules, originFunc, ref rulesParsed); | ||
11673 | 11683 | ||
11674 | while ((object)remaining != null && remaining.Length > 2) | 11684 | while ((object)remaining != null && remaining.Length > 2) |
11675 | { | 11685 | { |
11676 | LSL_Integer newLink = remaining.GetLSLIntegerItem(0); | 11686 | LSL_Integer newLink = remaining.GetLSLIntegerItem(0); |
11677 | LSL_List newrules = remaining.GetSublist(1, -1); | 11687 | LSL_List newrules = remaining.GetSublist(1, -1); |
11678 | foreach(SceneObjectPart part in GetLinkParts(obj, newLink)){ | 11688 | foreach(SceneObjectPart part in GetLinkParts(obj, newLink)){ |
11679 | remaining = SetPrimParams(part, newrules); | 11689 | remaining = SetPrimParams(part, newrules, originFunc, ref rulesParsed); |
11680 | } | 11690 | } |
11681 | } | 11691 | } |
11682 | } | 11692 | } |
@@ -12640,11 +12650,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
12640 | } | 12650 | } |
12641 | } | 12651 | } |
12642 | 12652 | ||
12643 | protected LSL_List SetPrimParams(ScenePresence av, LSL_List rules) | 12653 | protected LSL_List SetPrimParams(ScenePresence av, LSL_List rules, string originFunc, ref uint rulesParsed) |
12644 | { | 12654 | { |
12645 | //This is a special version of SetPrimParams to deal with avatars which are sat on the linkset. | 12655 | //This is a special version of SetPrimParams to deal with avatars which are sat on the linkset. |
12646 | 12656 | ||
12647 | int idx = 0; | 12657 | int idx = 0; |
12658 | int idxStart = 0; | ||
12648 | 12659 | ||
12649 | bool positionChanged = false; | 12660 | bool positionChanged = false; |
12650 | Vector3 finalPos = Vector3.Zero; | 12661 | Vector3 finalPos = Vector3.Zero; |
@@ -12653,9 +12664,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
12653 | { | 12664 | { |
12654 | while (idx < rules.Length) | 12665 | while (idx < rules.Length) |
12655 | { | 12666 | { |
12667 | ++rulesParsed; | ||
12656 | int code = rules.GetLSLIntegerItem(idx++); | 12668 | int code = rules.GetLSLIntegerItem(idx++); |
12657 | 12669 | ||
12658 | int remain = rules.Length - idx; | 12670 | int remain = rules.Length - idx; |
12671 | idxStart = idx; | ||
12659 | 12672 | ||
12660 | switch (code) | 12673 | switch (code) |
12661 | { | 12674 | { |
@@ -12809,7 +12822,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
12809 | } | 12822 | } |
12810 | } | 12823 | } |
12811 | } | 12824 | } |
12812 | 12825 | catch (InvalidCastException e) | |
12826 | { | ||
12827 | ShoutError(string.Format( | ||
12828 | "{0} error running rule #{1}: arg #{2} ", | ||
12829 | originFunc, rulesParsed, idx - idxStart) + e.Message); | ||
12830 | } | ||
12813 | finally | 12831 | finally |
12814 | { | 12832 | { |
12815 | if (positionChanged) | 12833 | if (positionChanged) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 5bc78d6..ceff889 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -3036,7 +3036,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3036 | m_host.AddScriptLPS(1); | 3036 | m_host.AddScriptLPS(1); |
3037 | InitLSL(); | 3037 | InitLSL(); |
3038 | 3038 | ||
3039 | m_LSL_Api.SetPrimitiveParamsEx(prim, rules); | 3039 | m_LSL_Api.SetPrimitiveParamsEx(prim, rules, "osSetPrimitiveParams"); |
3040 | } | 3040 | } |
3041 | 3041 | ||
3042 | /// <summary> | 3042 | /// <summary> |