diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 88 |
1 files changed, 65 insertions, 23 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 2bfb9b3..b001c51 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -5828,7 +5828,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5828 | 5828 | ||
5829 | List<SceneObjectPart> parts = GetLinkParts(linknumber); | 5829 | List<SceneObjectPart> parts = GetLinkParts(linknumber); |
5830 | 5830 | ||
5831 | foreach (var part in parts) | 5831 | foreach (SceneObjectPart part in parts) |
5832 | { | 5832 | { |
5833 | SetTextureAnim(part, mode, face, sizex, sizey, start, length, rate); | 5833 | SetTextureAnim(part, mode, face, sizex, sizey, start, length, rate); |
5834 | } | 5834 | } |
@@ -6190,7 +6190,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6190 | 6190 | ||
6191 | List<SceneObjectPart> parts = GetLinkParts(linknumber); | 6191 | List<SceneObjectPart> parts = GetLinkParts(linknumber); |
6192 | 6192 | ||
6193 | foreach (var part in parts) | 6193 | foreach (SceneObjectPart part in parts) |
6194 | { | 6194 | { |
6195 | SetParticleSystem(part, rules); | 6195 | SetParticleSystem(part, rules); |
6196 | } | 6196 | } |
@@ -7238,10 +7238,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7238 | foreach (SceneObjectPart part in parts) | 7238 | foreach (SceneObjectPart part in parts) |
7239 | remaining = SetPrimParams(part, rules); | 7239 | remaining = SetPrimParams(part, rules); |
7240 | 7240 | ||
7241 | while(remaining != null && remaining.Length > 2) | 7241 | while (remaining != null && remaining.Length > 2) |
7242 | { | 7242 | { |
7243 | linknumber = remaining.GetLSLIntegerItem(0); | 7243 | linknumber = remaining.GetLSLIntegerItem(0); |
7244 | rules = remaining.GetSublist(1,-1); | 7244 | rules = remaining.GetSublist(1, -1); |
7245 | parts = GetLinkParts(linknumber); | 7245 | parts = GetLinkParts(linknumber); |
7246 | 7246 | ||
7247 | foreach (SceneObjectPart part in parts) | 7247 | foreach (SceneObjectPart part in parts) |
@@ -7910,7 +7910,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7910 | public LSL_List llGetPrimitiveParams(LSL_List rules) | 7910 | public LSL_List llGetPrimitiveParams(LSL_List rules) |
7911 | { | 7911 | { |
7912 | m_host.AddScriptLPS(1); | 7912 | m_host.AddScriptLPS(1); |
7913 | return GetLinkPrimitiveParams(m_host, rules); | 7913 | |
7914 | LSL_List result = new LSL_List(); | ||
7915 | |||
7916 | LSL_List remaining = GetPrimParams(m_host, rules, ref result); | ||
7917 | |||
7918 | while (remaining != null && remaining.Length > 2) | ||
7919 | { | ||
7920 | int linknumber = remaining.GetLSLIntegerItem(0); | ||
7921 | rules = remaining.GetSublist(1, -1); | ||
7922 | List<SceneObjectPart> parts = GetLinkParts(linknumber); | ||
7923 | |||
7924 | foreach (SceneObjectPart part in parts) | ||
7925 | remaining = GetPrimParams(part, rules, ref result); | ||
7926 | } | ||
7927 | |||
7928 | return result; | ||
7914 | } | 7929 | } |
7915 | 7930 | ||
7916 | public LSL_List llGetLinkPrimitiveParams(int linknumber, LSL_List rules) | 7931 | public LSL_List llGetLinkPrimitiveParams(int linknumber, LSL_List rules) |
@@ -7920,19 +7935,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7920 | List<SceneObjectPart> parts = GetLinkParts(linknumber); | 7935 | List<SceneObjectPart> parts = GetLinkParts(linknumber); |
7921 | 7936 | ||
7922 | LSL_List res = new LSL_List(); | 7937 | LSL_List res = new LSL_List(); |
7938 | LSL_List remaining = null; | ||
7939 | |||
7940 | foreach (SceneObjectPart part in parts) | ||
7941 | { | ||
7942 | remaining = GetPrimParams(part, rules, ref res); | ||
7943 | } | ||
7923 | 7944 | ||
7924 | foreach (var part in parts) | 7945 | while (remaining != null && remaining.Length > 2) |
7925 | { | 7946 | { |
7926 | LSL_List partRes = GetLinkPrimitiveParams(part, rules); | 7947 | linknumber = remaining.GetLSLIntegerItem(0); |
7927 | res += partRes; | 7948 | rules = remaining.GetSublist(1, -1); |
7949 | parts = GetLinkParts(linknumber); | ||
7950 | |||
7951 | foreach (SceneObjectPart part in parts) | ||
7952 | remaining = GetPrimParams(part, rules, ref res); | ||
7928 | } | 7953 | } |
7929 | 7954 | ||
7930 | return res; | 7955 | return res; |
7931 | } | 7956 | } |
7932 | 7957 | ||
7933 | public LSL_List GetLinkPrimitiveParams(SceneObjectPart part, LSL_List rules) | 7958 | public LSL_List GetPrimParams(SceneObjectPart part, LSL_List rules, ref LSL_List res) |
7934 | { | 7959 | { |
7935 | LSL_List res = new LSL_List(); | ||
7936 | int idx=0; | 7960 | int idx=0; |
7937 | while (idx < rules.Length) | 7961 | while (idx < rules.Length) |
7938 | { | 7962 | { |
@@ -8077,7 +8101,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8077 | 8101 | ||
8078 | case (int)ScriptBaseClass.PRIM_TEXTURE: | 8102 | case (int)ScriptBaseClass.PRIM_TEXTURE: |
8079 | if (remain < 1) | 8103 | if (remain < 1) |
8080 | return res; | 8104 | return null; |
8081 | 8105 | ||
8082 | int face = (int)rules.GetLSLIntegerItem(idx++); | 8106 | int face = (int)rules.GetLSLIntegerItem(idx++); |
8083 | Primitive.TextureEntry tex = part.Shape.Textures; | 8107 | Primitive.TextureEntry tex = part.Shape.Textures; |
@@ -8117,7 +8141,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8117 | 8141 | ||
8118 | case (int)ScriptBaseClass.PRIM_COLOR: | 8142 | case (int)ScriptBaseClass.PRIM_COLOR: |
8119 | if (remain < 1) | 8143 | if (remain < 1) |
8120 | return res; | 8144 | return null; |
8121 | 8145 | ||
8122 | face=(int)rules.GetLSLIntegerItem(idx++); | 8146 | face=(int)rules.GetLSLIntegerItem(idx++); |
8123 | 8147 | ||
@@ -8146,7 +8170,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8146 | 8170 | ||
8147 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: | 8171 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: |
8148 | if (remain < 1) | 8172 | if (remain < 1) |
8149 | return res; | 8173 | return null; |
8150 | 8174 | ||
8151 | face=(int)rules.GetLSLIntegerItem(idx++); | 8175 | face=(int)rules.GetLSLIntegerItem(idx++); |
8152 | 8176 | ||
@@ -8177,7 +8201,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8177 | 8201 | ||
8178 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: | 8202 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: |
8179 | if (remain < 1) | 8203 | if (remain < 1) |
8180 | return res; | 8204 | return null; |
8181 | 8205 | ||
8182 | face=(int)rules.GetLSLIntegerItem(idx++); | 8206 | face=(int)rules.GetLSLIntegerItem(idx++); |
8183 | 8207 | ||
@@ -8219,7 +8243,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8219 | 8243 | ||
8220 | case (int)ScriptBaseClass.PRIM_TEXGEN: | 8244 | case (int)ScriptBaseClass.PRIM_TEXGEN: |
8221 | if (remain < 1) | 8245 | if (remain < 1) |
8222 | return res; | 8246 | return null; |
8223 | 8247 | ||
8224 | face=(int)rules.GetLSLIntegerItem(idx++); | 8248 | face=(int)rules.GetLSLIntegerItem(idx++); |
8225 | 8249 | ||
@@ -8260,7 +8284,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8260 | 8284 | ||
8261 | case (int)ScriptBaseClass.PRIM_GLOW: | 8285 | case (int)ScriptBaseClass.PRIM_GLOW: |
8262 | if (remain < 1) | 8286 | if (remain < 1) |
8263 | return res; | 8287 | return null; |
8264 | 8288 | ||
8265 | face=(int)rules.GetLSLIntegerItem(idx++); | 8289 | face=(int)rules.GetLSLIntegerItem(idx++); |
8266 | 8290 | ||
@@ -8312,9 +8336,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8312 | 0 | 8336 | 0 |
8313 | )); | 8337 | )); |
8314 | break; | 8338 | break; |
8339 | case (int)ScriptBaseClass.PRIM_LINK_TARGET: | ||
8340 | if(remain < 3) | ||
8341 | return null; | ||
8342 | |||
8343 | return rules.GetSublist(idx, -1); | ||
8315 | } | 8344 | } |
8316 | } | 8345 | } |
8317 | return res; | 8346 | |
8347 | return null; | ||
8318 | } | 8348 | } |
8319 | 8349 | ||
8320 | public LSL_List llGetPrimMediaParams(int face, LSL_List rules) | 8350 | public LSL_List llGetPrimMediaParams(int face, LSL_List rules) |
@@ -10752,16 +10782,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
10752 | } | 10782 | } |
10753 | } | 10783 | } |
10754 | 10784 | ||
10755 | public LSL_List GetLinkPrimitiveParamsEx(LSL_Key prim, LSL_List rules) | 10785 | public LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules) |
10756 | { | 10786 | { |
10757 | SceneObjectPart obj = World.GetSceneObjectPart(new UUID(prim)); | 10787 | SceneObjectPart obj = World.GetSceneObjectPart(new UUID(prim)); |
10758 | if (obj == null) | ||
10759 | return new LSL_List(); | ||
10760 | 10788 | ||
10761 | if (obj.OwnerID != m_host.OwnerID) | 10789 | LSL_List result = new LSL_List(); |
10762 | return new LSL_List(); | 10790 | |
10791 | if (obj != null && obj.OwnerID != m_host.OwnerID) | ||
10792 | { | ||
10793 | LSL_List remaining = GetPrimParams(obj, rules, ref result); | ||
10794 | |||
10795 | while (remaining != null && remaining.Length > 2) | ||
10796 | { | ||
10797 | int linknumber = remaining.GetLSLIntegerItem(0); | ||
10798 | rules = remaining.GetSublist(1, -1); | ||
10799 | List<SceneObjectPart> parts = GetLinkParts(linknumber); | ||
10763 | 10800 | ||
10764 | return GetLinkPrimitiveParams(obj, rules); | 10801 | foreach (SceneObjectPart part in parts) |
10802 | remaining = GetPrimParams(part, rules, ref result); | ||
10803 | } | ||
10804 | } | ||
10805 | |||
10806 | return result; | ||
10765 | } | 10807 | } |
10766 | 10808 | ||
10767 | public void print(string str) | 10809 | public void print(string str) |