aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs88
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs20
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs2
3 files changed, 83 insertions, 27 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)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 5e7c2d9..1afa4fb 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -2246,11 +2246,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2246 CheckThreatLevel(ThreatLevel.High, "osGetLinkPrimitiveParams"); 2246 CheckThreatLevel(ThreatLevel.High, "osGetLinkPrimitiveParams");
2247 m_host.AddScriptLPS(1); 2247 m_host.AddScriptLPS(1);
2248 InitLSL(); 2248 InitLSL();
2249 // One needs to cast m_LSL_Api because we're using functions not
2250 // on the ILSL_Api interface.
2251 LSL_Api LSL_Api = (LSL_Api)m_LSL_Api;
2249 LSL_List retVal = new LSL_List(); 2252 LSL_List retVal = new LSL_List();
2250 List<SceneObjectPart> parts = ((LSL_Api)m_LSL_Api).GetLinkParts(linknumber); 2253 LSL_List remaining = null;
2254 List<SceneObjectPart> parts = LSL_Api.GetLinkParts(linknumber);
2251 foreach (SceneObjectPart part in parts) 2255 foreach (SceneObjectPart part in parts)
2252 { 2256 {
2253 retVal += ((LSL_Api)m_LSL_Api).GetLinkPrimitiveParams(part, rules); 2257 remaining = LSL_Api.GetPrimParams(part, rules, ref retVal);
2258 }
2259
2260 while (remaining != null && remaining.Length > 2)
2261 {
2262 linknumber = remaining.GetLSLIntegerItem(0);
2263 rules = remaining.GetSublist(1, -1);
2264 parts = LSL_Api.GetLinkParts(linknumber);
2265
2266 foreach (SceneObjectPart part in parts)
2267 remaining = LSL_Api.GetPrimParams(part, rules, ref retVal);
2254 } 2268 }
2255 return retVal; 2269 return retVal;
2256 } 2270 }
@@ -2965,7 +2979,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2965 m_host.AddScriptLPS(1); 2979 m_host.AddScriptLPS(1);
2966 InitLSL(); 2980 InitLSL();
2967 2981
2968 return m_LSL_Api.GetLinkPrimitiveParamsEx(prim, rules); 2982 return m_LSL_Api.GetPrimitiveParamsEx(prim, rules);
2969 } 2983 }
2970 2984
2971 public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules) 2985 public void osSetPrimitiveParams(LSL_Key prim, LSL_List rules)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
index 3fb463b..cd58614 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
@@ -425,6 +425,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
425 void print(string str); 425 void print(string str);
426 426
427 void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules); 427 void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules);
428 LSL_List GetLinkPrimitiveParamsEx(LSL_Key prim, LSL_List rules); 428 LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules);
429 } 429 }
430} 430}