aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs222
2 files changed, 107 insertions, 117 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index b1f41b8..6be2bd7 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -126,7 +126,7 @@ namespace OpenSim.Framework
126 public delegate void ObjectDrop(uint localID, IClientAPI remoteClient); 126 public delegate void ObjectDrop(uint localID, IClientAPI remoteClient);
127 127
128 public delegate void UpdatePrimFlags( 128 public delegate void UpdatePrimFlags(
129 uint localID, bool UsePhysics, bool IsTemporary, bool IsPhantom,ExtraPhysicsData PhysData, IClientAPI remoteClient); 129 uint localID, bool UsePhysics, bool IsTemporary, bool IsPhantom, ExtraPhysicsData PhysData, IClientAPI remoteClient);
130 130
131 public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); 131 public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient);
132 132
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 1115542..42f77c6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -338,34 +338,39 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
338 338
339 public List<SceneObjectPart> GetLinkParts(int linkType) 339 public List<SceneObjectPart> GetLinkParts(int linkType)
340 { 340 {
341 return GetLinkParts(m_host, linkType);
342 }
343
344 private List<SceneObjectPart> GetLinkParts(SceneObjectPart part, int linkType)
345 {
341 List<SceneObjectPart> ret = new List<SceneObjectPart>(); 346 List<SceneObjectPart> ret = new List<SceneObjectPart>();
342 if (m_host == null || m_host.ParentGroup == null || m_host.ParentGroup.IsDeleted) 347 if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
343 return ret; 348 return ret;
344 ret.Add(m_host); 349 ret.Add(part);
345 350
346 switch (linkType) 351 switch (linkType)
347 { 352 {
348 case ScriptBaseClass.LINK_SET: 353 case ScriptBaseClass.LINK_SET:
349 return new List<SceneObjectPart>(m_host.ParentGroup.Parts); 354 return new List<SceneObjectPart>(part.ParentGroup.Parts);
350 355
351 case ScriptBaseClass.LINK_ROOT: 356 case ScriptBaseClass.LINK_ROOT:
352 ret = new List<SceneObjectPart>(); 357 ret = new List<SceneObjectPart>();
353 ret.Add(m_host.ParentGroup.RootPart); 358 ret.Add(part.ParentGroup.RootPart);
354 return ret; 359 return ret;
355 360
356 case ScriptBaseClass.LINK_ALL_OTHERS: 361 case ScriptBaseClass.LINK_ALL_OTHERS:
357 ret = new List<SceneObjectPart>(m_host.ParentGroup.Parts); 362 ret = new List<SceneObjectPart>(part.ParentGroup.Parts);
358 363
359 if (ret.Contains(m_host)) 364 if (ret.Contains(part))
360 ret.Remove(m_host); 365 ret.Remove(part);
361 366
362 return ret; 367 return ret;
363 368
364 case ScriptBaseClass.LINK_ALL_CHILDREN: 369 case ScriptBaseClass.LINK_ALL_CHILDREN:
365 ret = new List<SceneObjectPart>(m_host.ParentGroup.Parts); 370 ret = new List<SceneObjectPart>(part.ParentGroup.Parts);
366 371
367 if (ret.Contains(m_host.ParentGroup.RootPart)) 372 if (ret.Contains(part.ParentGroup.RootPart))
368 ret.Remove(m_host.ParentGroup.RootPart); 373 ret.Remove(part.ParentGroup.RootPart);
369 return ret; 374 return ret;
370 375
371 case ScriptBaseClass.LINK_THIS: 376 case ScriptBaseClass.LINK_THIS:
@@ -375,7 +380,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
375 if (linkType < 0) 380 if (linkType < 0)
376 return new List<SceneObjectPart>(); 381 return new List<SceneObjectPart>();
377 382
378 SceneObjectPart target = m_host.ParentGroup.GetLinkNumPart(linkType); 383 SceneObjectPart target = part.ParentGroup.GetLinkNumPart(linkType);
379 if (target == null) 384 if (target == null)
380 return new List<SceneObjectPart>(); 385 return new List<SceneObjectPart>();
381 ret = new List<SceneObjectPart>(); 386 ret = new List<SceneObjectPart>();
@@ -7750,7 +7755,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7750 public void llSetPrimitiveParams(LSL_List rules) 7755 public void llSetPrimitiveParams(LSL_List rules)
7751 { 7756 {
7752 m_host.AddScriptLPS(1); 7757 m_host.AddScriptLPS(1);
7753 SetPrimParams(m_host, rules); 7758
7759 setLinkPrimParams(ScriptBaseClass.LINK_THIS, rules);
7754 7760
7755 ScriptSleep(200); 7761 ScriptSleep(200);
7756 } 7762 }
@@ -7764,26 +7770,37 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7764 7770
7765 private void setLinkPrimParams(int linknumber, LSL_List rules) 7771 private void setLinkPrimParams(int linknumber, LSL_List rules)
7766 { 7772 {
7767 List<SceneObjectPart> parts = GetLinkParts(linknumber); 7773 List<object> parts = new List<object>();
7774 List<SceneObjectPart> prims = GetLinkParts(linknumber);
7768 List<ScenePresence> avatars = GetLinkAvatars(linknumber); 7775 List<ScenePresence> avatars = GetLinkAvatars(linknumber);
7769 if (parts.Count>0) 7776 foreach (SceneObjectPart p in prims)
7777 parts.Add(p);
7778 foreach (ScenePresence p in avatars)
7779 parts.Add(p);
7780
7781 LSL_List remaining = null;
7782
7783 if (parts.Count > 0)
7770 { 7784 {
7771 try 7785 foreach (SceneObjectPart part in parts)
7786 remaining = SetPrimParams(part, rules);
7787
7788 while(remaining != null && remaining.Length > 2)
7772 { 7789 {
7773 parts[0].ParentGroup.areUpdatesSuspended = true; 7790 linknumber = remaining.GetLSLIntegerItem(0);
7791 rules = remaining.GetSublist(1,-1);
7792 parts.Clear();
7793 prims = GetLinkParts(linknumber);
7794 avatars = GetLinkAvatars(linknumber);
7795 foreach (SceneObjectPart p in prims)
7796 parts.Add(p);
7797 foreach (ScenePresence p in avatars)
7798 parts.Add(p);
7799
7774 foreach (SceneObjectPart part in parts) 7800 foreach (SceneObjectPart part in parts)
7775 SetPrimParams(part, rules); 7801 remaining = SetPrimParams(part, rules);
7776 }
7777 finally
7778 {
7779 parts[0].ParentGroup.areUpdatesSuspended = false;
7780 } 7802 }
7781 } 7803 }
7782 if (avatars.Count > 0)
7783 {
7784 foreach (ScenePresence avatar in avatars)
7785 SetPrimParams(avatar, rules);
7786 }
7787 } 7804 }
7788 7805
7789 private void SetPhysicsMaterial(SceneObjectPart part, int material_bits, 7806 private void SetPhysicsMaterial(SceneObjectPart part, int material_bits,
@@ -7845,7 +7862,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7845 return new Vector3((float)x, (float)y, (float)z); 7862 return new Vector3((float)x, (float)y, (float)z);
7846 } 7863 }
7847 7864
7848 protected void SetPrimParams(ScenePresence av, LSL_List rules) 7865 protected LSL_List SetPrimParams(ScenePresence av, LSL_List rules)
7849 { 7866 {
7850 //This is a special version of SetPrimParams to deal with avatars which are sat on the linkset. 7867 //This is a special version of SetPrimParams to deal with avatars which are sat on the linkset.
7851 7868
@@ -7868,7 +7885,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7868 case (int)ScriptBaseClass.PRIM_POS_LOCAL: 7885 case (int)ScriptBaseClass.PRIM_POS_LOCAL:
7869 { 7886 {
7870 if (remain < 1) 7887 if (remain < 1)
7871 return; 7888 return null;
7872 7889
7873 LSL_Vector v; 7890 LSL_Vector v;
7874 v = rules.GetVector3Item(idx++); 7891 v = rules.GetVector3Item(idx++);
@@ -7902,7 +7919,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7902 case (int)ScriptBaseClass.PRIM_ROTATION: 7919 case (int)ScriptBaseClass.PRIM_ROTATION:
7903 { 7920 {
7904 if (remain < 1) 7921 if (remain < 1)
7905 return; 7922 return null;
7906 7923
7907 LSL_Rotation r; 7924 LSL_Rotation r;
7908 r = rules.GetQuaternionItem(idx++); 7925 r = rules.GetQuaternionItem(idx++);
@@ -7933,7 +7950,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7933 case (int)ScriptBaseClass.PRIM_NAME: 7950 case (int)ScriptBaseClass.PRIM_NAME:
7934 case (int)ScriptBaseClass.PRIM_DESC: 7951 case (int)ScriptBaseClass.PRIM_DESC:
7935 if (remain < 1) 7952 if (remain < 1)
7936 return; 7953 return null;
7937 idx++; 7954 idx++;
7938 break; 7955 break;
7939 7956
@@ -7941,13 +7958,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7941 case (int)ScriptBaseClass.PRIM_FULLBRIGHT: 7958 case (int)ScriptBaseClass.PRIM_FULLBRIGHT:
7942 case (int)ScriptBaseClass.PRIM_TEXGEN: 7959 case (int)ScriptBaseClass.PRIM_TEXGEN:
7943 if (remain < 2) 7960 if (remain < 2)
7944 return; 7961 return null;
7945 idx += 2; 7962 idx += 2;
7946 break; 7963 break;
7947 7964
7948 case (int)ScriptBaseClass.PRIM_TYPE: 7965 case (int)ScriptBaseClass.PRIM_TYPE:
7949 if (remain < 3) 7966 if (remain < 3)
7950 return; 7967 return null;
7951 code = (int)rules.GetLSLIntegerItem(idx++); 7968 code = (int)rules.GetLSLIntegerItem(idx++);
7952 remain = rules.Length - idx; 7969 remain = rules.Length - idx;
7953 switch (code) 7970 switch (code)
@@ -7956,13 +7973,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7956 case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER: 7973 case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER:
7957 case (int)ScriptBaseClass.PRIM_TYPE_PRISM: 7974 case (int)ScriptBaseClass.PRIM_TYPE_PRISM:
7958 if (remain < 6) 7975 if (remain < 6)
7959 return; 7976 return null;
7960 idx += 6; 7977 idx += 6;
7961 break; 7978 break;
7962 7979
7963 case (int)ScriptBaseClass.PRIM_TYPE_SPHERE: 7980 case (int)ScriptBaseClass.PRIM_TYPE_SPHERE:
7964 if (remain < 5) 7981 if (remain < 5)
7965 return; 7982 return null;
7966 idx += 5; 7983 idx += 5;
7967 break; 7984 break;
7968 7985
@@ -7970,13 +7987,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7970 case (int)ScriptBaseClass.PRIM_TYPE_TUBE: 7987 case (int)ScriptBaseClass.PRIM_TYPE_TUBE:
7971 case (int)ScriptBaseClass.PRIM_TYPE_RING: 7988 case (int)ScriptBaseClass.PRIM_TYPE_RING:
7972 if (remain < 11) 7989 if (remain < 11)
7973 return; 7990 return null;
7974 idx += 11; 7991 idx += 11;
7975 break; 7992 break;
7976 7993
7977 case (int)ScriptBaseClass.PRIM_TYPE_SCULPT: 7994 case (int)ScriptBaseClass.PRIM_TYPE_SCULPT:
7978 if (remain < 2) 7995 if (remain < 2)
7979 return; 7996 return null;
7980 idx += 2; 7997 idx += 2;
7981 break; 7998 break;
7982 } 7999 }
@@ -7987,7 +8004,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7987 case (int)ScriptBaseClass.PRIM_BUMP_SHINY: 8004 case (int)ScriptBaseClass.PRIM_BUMP_SHINY:
7988 case (int)ScriptBaseClass.PRIM_OMEGA: 8005 case (int)ScriptBaseClass.PRIM_OMEGA:
7989 if (remain < 3) 8006 if (remain < 3)
7990 return; 8007 return null;
7991 idx += 3; 8008 idx += 3;
7992 break; 8009 break;
7993 8010
@@ -7995,33 +8012,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7995 case (int)ScriptBaseClass.PRIM_POINT_LIGHT: 8012 case (int)ScriptBaseClass.PRIM_POINT_LIGHT:
7996 case (int)ScriptBaseClass.PRIM_PHYSICS_MATERIAL: 8013 case (int)ScriptBaseClass.PRIM_PHYSICS_MATERIAL:
7997 if (remain < 5) 8014 if (remain < 5)
7998 return; 8015 return null;
7999 idx += 5; 8016 idx += 5;
8000 break; 8017 break;
8001 8018
8002 case (int)ScriptBaseClass.PRIM_FLEXIBLE: 8019 case (int)ScriptBaseClass.PRIM_FLEXIBLE:
8003 if (remain < 7) 8020 if (remain < 7)
8004 return; 8021 return null;
8005 8022
8006 idx += 7; 8023 idx += 7;
8007 break; 8024 break;
8008 8025
8009 case (int)ScriptBaseClass.PRIM_LINK_TARGET: 8026 case (int)ScriptBaseClass.PRIM_LINK_TARGET:
8010 if (remain < 3) // setting to 3 on the basis that parsing any usage of PRIM_LINK_TARGET that has nothing following it is pointless. 8027 if (remain < 3) // setting to 3 on the basis that parsing any usage of PRIM_LINK_TARGET that has nothing following it is pointless.
8011 return; 8028 return null;
8012
8013 if (positionChanged)
8014 {
8015 positionChanged = false;
8016 av.OffsetPosition = finalPos;
8017// av.SendAvatarDataToAllAgents();
8018 av.SendTerseUpdateToAllClients();
8019 }
8020 8029
8021 LSL_Integer new_linknumber = rules.GetLSLIntegerItem(idx++); 8030 return rules.GetSublist(idx, -1);
8022 LSL_List new_rules = rules.GetSublist(idx, -1);
8023 setLinkPrimParams((int)new_linknumber, new_rules);
8024 return;
8025 } 8031 }
8026 } 8032 }
8027 } 8033 }
@@ -8036,12 +8042,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8036 positionChanged = false; 8042 positionChanged = false;
8037 } 8043 }
8038 } 8044 }
8045 return null;
8039 } 8046 }
8040 8047
8041 protected void SetPrimParams(SceneObjectPart part, LSL_List rules) 8048 protected LSL_List SetPrimParams(SceneObjectPart part, LSL_List rules)
8042 { 8049 {
8043 if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted) 8050 if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
8044 return; 8051 return null;
8045 8052
8046 int idx = 0; 8053 int idx = 0;
8047 8054
@@ -8066,7 +8073,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8066 case (int)ScriptBaseClass.PRIM_POSITION: 8073 case (int)ScriptBaseClass.PRIM_POSITION:
8067 case (int)ScriptBaseClass.PRIM_POS_LOCAL: 8074 case (int)ScriptBaseClass.PRIM_POS_LOCAL:
8068 if (remain < 1) 8075 if (remain < 1)
8069 return; 8076 return null;
8070 8077
8071 v=rules.GetVector3Item(idx++); 8078 v=rules.GetVector3Item(idx++);
8072 currentPosition = GetSetPosTarget(part, v, currentPosition); 8079 currentPosition = GetSetPosTarget(part, v, currentPosition);
@@ -8075,7 +8082,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8075 break; 8082 break;
8076 case (int)ScriptBaseClass.PRIM_SIZE: 8083 case (int)ScriptBaseClass.PRIM_SIZE:
8077 if (remain < 1) 8084 if (remain < 1)
8078 return; 8085 return null;
8079 8086
8080 v=rules.GetVector3Item(idx++); 8087 v=rules.GetVector3Item(idx++);
8081 SetScale(part, v); 8088 SetScale(part, v);
@@ -8083,7 +8090,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8083 break; 8090 break;
8084 case (int)ScriptBaseClass.PRIM_ROTATION: 8091 case (int)ScriptBaseClass.PRIM_ROTATION:
8085 if (remain < 1) 8092 if (remain < 1)
8086 return; 8093 return null;
8087 8094
8088 LSL_Rotation q = rules.GetQuaternionItem(idx++); 8095 LSL_Rotation q = rules.GetQuaternionItem(idx++);
8089 SceneObjectPart rootPart = parentgrp.RootPart; 8096 SceneObjectPart rootPart = parentgrp.RootPart;
@@ -8104,7 +8111,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8104 8111
8105 case (int)ScriptBaseClass.PRIM_TYPE: 8112 case (int)ScriptBaseClass.PRIM_TYPE:
8106 if (remain < 3) 8113 if (remain < 3)
8107 return; 8114 return null;
8108 8115
8109 code = (int)rules.GetLSLIntegerItem(idx++); 8116 code = (int)rules.GetLSLIntegerItem(idx++);
8110 8117
@@ -8123,7 +8130,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8123 { 8130 {
8124 case (int)ScriptBaseClass.PRIM_TYPE_BOX: 8131 case (int)ScriptBaseClass.PRIM_TYPE_BOX:
8125 if (remain < 6) 8132 if (remain < 6)
8126 return; 8133 return null;
8127 8134
8128 face = (int)rules.GetLSLIntegerItem(idx++); 8135 face = (int)rules.GetLSLIntegerItem(idx++);
8129 v = rules.GetVector3Item(idx++); // cut 8136 v = rules.GetVector3Item(idx++); // cut
@@ -8138,7 +8145,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8138 8145
8139 case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER: 8146 case (int)ScriptBaseClass.PRIM_TYPE_CYLINDER:
8140 if (remain < 6) 8147 if (remain < 6)
8141 return; 8148 return null;
8142 8149
8143 face = (int)rules.GetLSLIntegerItem(idx++); // holeshape 8150 face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
8144 v = rules.GetVector3Item(idx++); // cut 8151 v = rules.GetVector3Item(idx++); // cut
@@ -8152,7 +8159,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8152 8159
8153 case (int)ScriptBaseClass.PRIM_TYPE_PRISM: 8160 case (int)ScriptBaseClass.PRIM_TYPE_PRISM:
8154 if (remain < 6) 8161 if (remain < 6)
8155 return; 8162 return null;
8156 8163
8157 face = (int)rules.GetLSLIntegerItem(idx++); // holeshape 8164 face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
8158 v = rules.GetVector3Item(idx++); //cut 8165 v = rules.GetVector3Item(idx++); //cut
@@ -8166,7 +8173,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8166 8173
8167 case (int)ScriptBaseClass.PRIM_TYPE_SPHERE: 8174 case (int)ScriptBaseClass.PRIM_TYPE_SPHERE:
8168 if (remain < 5) 8175 if (remain < 5)
8169 return; 8176 return null;
8170 8177
8171 face = (int)rules.GetLSLIntegerItem(idx++); // holeshape 8178 face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
8172 v = rules.GetVector3Item(idx++); // cut 8179 v = rules.GetVector3Item(idx++); // cut
@@ -8179,7 +8186,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8179 8186
8180 case (int)ScriptBaseClass.PRIM_TYPE_TORUS: 8187 case (int)ScriptBaseClass.PRIM_TYPE_TORUS:
8181 if (remain < 11) 8188 if (remain < 11)
8182 return; 8189 return null;
8183 8190
8184 face = (int)rules.GetLSLIntegerItem(idx++); // holeshape 8191 face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
8185 v = rules.GetVector3Item(idx++); //cut 8192 v = rules.GetVector3Item(idx++); //cut
@@ -8198,7 +8205,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8198 8205
8199 case (int)ScriptBaseClass.PRIM_TYPE_TUBE: 8206 case (int)ScriptBaseClass.PRIM_TYPE_TUBE:
8200 if (remain < 11) 8207 if (remain < 11)
8201 return; 8208 return null;
8202 8209
8203 face = (int)rules.GetLSLIntegerItem(idx++); // holeshape 8210 face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
8204 v = rules.GetVector3Item(idx++); //cut 8211 v = rules.GetVector3Item(idx++); //cut
@@ -8217,7 +8224,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8217 8224
8218 case (int)ScriptBaseClass.PRIM_TYPE_RING: 8225 case (int)ScriptBaseClass.PRIM_TYPE_RING:
8219 if (remain < 11) 8226 if (remain < 11)
8220 return; 8227 return null;
8221 8228
8222 face = (int)rules.GetLSLIntegerItem(idx++); // holeshape 8229 face = (int)rules.GetLSLIntegerItem(idx++); // holeshape
8223 v = rules.GetVector3Item(idx++); //cut 8230 v = rules.GetVector3Item(idx++); //cut
@@ -8236,7 +8243,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8236 8243
8237 case (int)ScriptBaseClass.PRIM_TYPE_SCULPT: 8244 case (int)ScriptBaseClass.PRIM_TYPE_SCULPT:
8238 if (remain < 2) 8245 if (remain < 2)
8239 return; 8246 return null;
8240 8247
8241 string map = rules.Data[idx++].ToString(); 8248 string map = rules.Data[idx++].ToString();
8242 face = (int)rules.GetLSLIntegerItem(idx++); // type 8249 face = (int)rules.GetLSLIntegerItem(idx++); // type
@@ -8248,7 +8255,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8248 8255
8249 case (int)ScriptBaseClass.PRIM_TEXTURE: 8256 case (int)ScriptBaseClass.PRIM_TEXTURE:
8250 if (remain < 5) 8257 if (remain < 5)
8251 return; 8258 return null;
8252 8259
8253 face=(int)rules.GetLSLIntegerItem(idx++); 8260 face=(int)rules.GetLSLIntegerItem(idx++);
8254 string tex=rules.Data[idx++].ToString(); 8261 string tex=rules.Data[idx++].ToString();
@@ -8265,7 +8272,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8265 8272
8266 case (int)ScriptBaseClass.PRIM_COLOR: 8273 case (int)ScriptBaseClass.PRIM_COLOR:
8267 if (remain < 3) 8274 if (remain < 3)
8268 return; 8275 return null;
8269 8276
8270 face=(int)rules.GetLSLIntegerItem(idx++); 8277 face=(int)rules.GetLSLIntegerItem(idx++);
8271 LSL_Vector color=rules.GetVector3Item(idx++); 8278 LSL_Vector color=rules.GetVector3Item(idx++);
@@ -8278,7 +8285,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8278 8285
8279 case (int)ScriptBaseClass.PRIM_FLEXIBLE: 8286 case (int)ScriptBaseClass.PRIM_FLEXIBLE:
8280 if (remain < 7) 8287 if (remain < 7)
8281 return; 8288 return null;
8282 8289
8283 bool flexi = rules.GetLSLIntegerItem(idx++); 8290 bool flexi = rules.GetLSLIntegerItem(idx++);
8284 int softness = rules.GetLSLIntegerItem(idx++); 8291 int softness = rules.GetLSLIntegerItem(idx++);
@@ -8294,7 +8301,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8294 8301
8295 case (int)ScriptBaseClass.PRIM_POINT_LIGHT: 8302 case (int)ScriptBaseClass.PRIM_POINT_LIGHT:
8296 if (remain < 5) 8303 if (remain < 5)
8297 return; 8304 return null;
8298 bool light = rules.GetLSLIntegerItem(idx++); 8305 bool light = rules.GetLSLIntegerItem(idx++);
8299 LSL_Vector lightcolor = rules.GetVector3Item(idx++); 8306 LSL_Vector lightcolor = rules.GetVector3Item(idx++);
8300 float intensity = (float)rules.GetLSLFloatItem(idx++); 8307 float intensity = (float)rules.GetLSLFloatItem(idx++);
@@ -8307,7 +8314,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8307 8314
8308 case (int)ScriptBaseClass.PRIM_GLOW: 8315 case (int)ScriptBaseClass.PRIM_GLOW:
8309 if (remain < 2) 8316 if (remain < 2)
8310 return; 8317 return null;
8311 face = rules.GetLSLIntegerItem(idx++); 8318 face = rules.GetLSLIntegerItem(idx++);
8312 float glow = (float)rules.GetLSLFloatItem(idx++); 8319 float glow = (float)rules.GetLSLFloatItem(idx++);
8313 8320
@@ -8317,7 +8324,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8317 8324
8318 case (int)ScriptBaseClass.PRIM_BUMP_SHINY: 8325 case (int)ScriptBaseClass.PRIM_BUMP_SHINY:
8319 if (remain < 3) 8326 if (remain < 3)
8320 return; 8327 return null;
8321 face = (int)rules.GetLSLIntegerItem(idx++); 8328 face = (int)rules.GetLSLIntegerItem(idx++);
8322 int shiny = (int)rules.GetLSLIntegerItem(idx++); 8329 int shiny = (int)rules.GetLSLIntegerItem(idx++);
8323 Bumpiness bump = (Bumpiness)(int)rules.GetLSLIntegerItem(idx++); 8330 Bumpiness bump = (Bumpiness)(int)rules.GetLSLIntegerItem(idx++);
@@ -8328,7 +8335,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8328 8335
8329 case (int)ScriptBaseClass.PRIM_FULLBRIGHT: 8336 case (int)ScriptBaseClass.PRIM_FULLBRIGHT:
8330 if (remain < 2) 8337 if (remain < 2)
8331 return; 8338 return null;
8332 face = rules.GetLSLIntegerItem(idx++); 8339 face = rules.GetLSLIntegerItem(idx++);
8333 bool st = rules.GetLSLIntegerItem(idx++); 8340 bool st = rules.GetLSLIntegerItem(idx++);
8334 SetFullBright(part, face , st); 8341 SetFullBright(part, face , st);
@@ -8336,17 +8343,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8336 8343
8337 case (int)ScriptBaseClass.PRIM_MATERIAL: 8344 case (int)ScriptBaseClass.PRIM_MATERIAL:
8338 if (remain < 1) 8345 if (remain < 1)
8339 return; 8346 return null;
8340 int mat = rules.GetLSLIntegerItem(idx++); 8347 int mat = rules.GetLSLIntegerItem(idx++);
8341 if (mat < 0 || mat > 7) 8348 if (mat < 0 || mat > 7)
8342 return; 8349 return null;
8343 8350
8344 part.Material = Convert.ToByte(mat); 8351 part.Material = Convert.ToByte(mat);
8345 break; 8352 break;
8346 8353
8347 case (int)ScriptBaseClass.PRIM_PHANTOM: 8354 case (int)ScriptBaseClass.PRIM_PHANTOM:
8348 if (remain < 1) 8355 if (remain < 1)
8349 return; 8356 return null;
8350 8357
8351 string ph = rules.Data[idx++].ToString(); 8358 string ph = rules.Data[idx++].ToString();
8352 parentgrp.ScriptSetPhantomStatus(ph.Equals("1")); 8359 parentgrp.ScriptSetPhantomStatus(ph.Equals("1"));
@@ -8355,7 +8362,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8355 8362
8356 case (int)ScriptBaseClass.PRIM_PHYSICS: 8363 case (int)ScriptBaseClass.PRIM_PHYSICS:
8357 if (remain < 1) 8364 if (remain < 1)
8358 return; 8365 return null;
8359 string phy = rules.Data[idx++].ToString(); 8366 string phy = rules.Data[idx++].ToString();
8360 bool physics; 8367 bool physics;
8361 8368
@@ -8369,7 +8376,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8369 8376
8370 case (int)ScriptBaseClass.PRIM_PHYSICS_SHAPE_TYPE: 8377 case (int)ScriptBaseClass.PRIM_PHYSICS_SHAPE_TYPE:
8371 if (remain < 1) 8378 if (remain < 1)
8372 return; 8379 return null;
8373 8380
8374 int shape_type = rules.GetLSLIntegerItem(idx++); 8381 int shape_type = rules.GetLSLIntegerItem(idx++);
8375 8382
@@ -8385,7 +8392,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8385 8392
8386 case (int)ScriptBaseClass.PRIM_PHYSICS_MATERIAL: 8393 case (int)ScriptBaseClass.PRIM_PHYSICS_MATERIAL:
8387 if (remain < 5) 8394 if (remain < 5)
8388 return; 8395 return null;
8389 8396
8390 int material_bits = rules.GetLSLIntegerItem(idx++); 8397 int material_bits = rules.GetLSLIntegerItem(idx++);
8391 float material_density = (float)rules.GetLSLFloatItem(idx++); 8398 float material_density = (float)rules.GetLSLFloatItem(idx++);
@@ -8399,7 +8406,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8399 8406
8400 case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ: 8407 case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ:
8401 if (remain < 1) 8408 if (remain < 1)
8402 return; 8409 return null;
8403 string temp = rules.Data[idx++].ToString(); 8410 string temp = rules.Data[idx++].ToString();
8404 8411
8405 parentgrp.ScriptSetTemporaryStatus(temp.Equals("1")); 8412 parentgrp.ScriptSetTemporaryStatus(temp.Equals("1"));
@@ -8408,7 +8415,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8408 8415
8409 case (int)ScriptBaseClass.PRIM_TEXGEN: 8416 case (int)ScriptBaseClass.PRIM_TEXGEN:
8410 if (remain < 2) 8417 if (remain < 2)
8411 return; 8418 return null;
8412 //face,type 8419 //face,type
8413 face = rules.GetLSLIntegerItem(idx++); 8420 face = rules.GetLSLIntegerItem(idx++);
8414 int style = rules.GetLSLIntegerItem(idx++); 8421 int style = rules.GetLSLIntegerItem(idx++);
@@ -8416,7 +8423,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8416 break; 8423 break;
8417 case (int)ScriptBaseClass.PRIM_TEXT: 8424 case (int)ScriptBaseClass.PRIM_TEXT:
8418 if (remain < 3) 8425 if (remain < 3)
8419 return; 8426 return null;
8420 string primText = rules.GetLSLStringItem(idx++); 8427 string primText = rules.GetLSLStringItem(idx++);
8421 LSL_Vector primTextColor = rules.GetVector3Item(idx++); 8428 LSL_Vector primTextColor = rules.GetVector3Item(idx++);
8422 LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++); 8429 LSL_Float primTextAlpha = rules.GetLSLFloatItem(idx++);
@@ -8428,26 +8435,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8428 break; 8435 break;
8429 case (int)ScriptBaseClass.PRIM_NAME: 8436 case (int)ScriptBaseClass.PRIM_NAME:
8430 if (remain < 1) 8437 if (remain < 1)
8431 return; 8438 return null;
8432 string primName = rules.GetLSLStringItem(idx++); 8439 string primName = rules.GetLSLStringItem(idx++);
8433 part.Name = primName; 8440 part.Name = primName;
8434 break; 8441 break;
8435 case (int)ScriptBaseClass.PRIM_DESC: 8442 case (int)ScriptBaseClass.PRIM_DESC:
8436 if (remain < 1) 8443 if (remain < 1)
8437 return; 8444 return null;
8438 string primDesc = rules.GetLSLStringItem(idx++); 8445 string primDesc = rules.GetLSLStringItem(idx++);
8439 part.Description = primDesc; 8446 part.Description = primDesc;
8440 break; 8447 break;
8441 case (int)ScriptBaseClass.PRIM_ROT_LOCAL: 8448 case (int)ScriptBaseClass.PRIM_ROT_LOCAL:
8442 if (remain < 1) 8449 if (remain < 1)
8443 return; 8450 return null;
8444
8445 LSL_Rotation lr = rules.GetQuaternionItem(idx++); 8451 LSL_Rotation lr = rules.GetQuaternionItem(idx++);
8446 SetRot(part, Rot2Quaternion(lr)); 8452 SetRot(part, Rot2Quaternion(lr));
8447 break; 8453 break;
8448 case (int)ScriptBaseClass.PRIM_OMEGA: 8454 case (int)ScriptBaseClass.PRIM_OMEGA:
8449 if (remain < 3) 8455 if (remain < 3)
8450 return; 8456 return null;
8451 LSL_Vector axis = rules.GetVector3Item(idx++); 8457 LSL_Vector axis = rules.GetVector3Item(idx++);
8452 LSL_Float spinrate = rules.GetLSLFloatItem(idx++); 8458 LSL_Float spinrate = rules.GetLSLFloatItem(idx++);
8453 LSL_Float gain = rules.GetLSLFloatItem(idx++); 8459 LSL_Float gain = rules.GetLSLFloatItem(idx++);
@@ -8456,35 +8462,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8456 8462
8457 case (int)ScriptBaseClass.PRIM_LINK_TARGET: 8463 case (int)ScriptBaseClass.PRIM_LINK_TARGET:
8458 if (remain < 3) // setting to 3 on the basis that parsing any usage of PRIM_LINK_TARGET that has nothing following it is pointless. 8464 if (remain < 3) // setting to 3 on the basis that parsing any usage of PRIM_LINK_TARGET that has nothing following it is pointless.
8459 return; 8465 return null;
8460
8461 // do a pending position change before jumping to other part/avatar
8462 if (positionChanged)
8463 {
8464 positionChanged = false;
8465 if (parentgrp == null)
8466 return;
8467
8468 if (parentgrp.RootPart == part)
8469 {
8470
8471 Util.FireAndForget(delegate(object x)
8472 {
8473 parentgrp.UpdateGroupPosition(new Vector3((float)currentPosition.x, (float)currentPosition.y, (float)currentPosition.z));
8474 });
8475 }
8476 else
8477 {
8478 part.OffsetPosition = new Vector3((float)currentPosition.x, (float)currentPosition.y, (float)currentPosition.z);
8479 parentgrp.HasGroupChanged = true;
8480 parentgrp.ScheduleGroupForTerseUpdate();
8481 }
8482 }
8483 8466
8484 LSL_Integer new_linknumber = rules.GetLSLIntegerItem(idx++); 8467 return rules.GetSublist(idx, -1);
8485 LSL_List new_rules = rules.GetSublist(idx, -1);
8486 setLinkPrimParams((int)new_linknumber, new_rules);
8487 return;
8488 } 8468 }
8489 } 8469 }
8490 } 8470 }
@@ -8508,6 +8488,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8508 } 8488 }
8509 } 8489 }
8510 } 8490 }
8491 return null;
8511 } 8492 }
8512 8493
8513 public LSL_String llStringToBase64(string str) 8494 public LSL_String llStringToBase64(string str)
@@ -12143,7 +12124,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
12143 if (obj.OwnerID != m_host.OwnerID) 12124 if (obj.OwnerID != m_host.OwnerID)
12144 return; 12125 return;
12145 12126
12146 SetPrimParams(obj, rules); 12127 LSL_List remaining = SetPrimParams(obj, rules);
12128
12129 while (remaining != null && remaining.Length > 2)
12130 {
12131 LSL_Integer newLink = remaining.GetLSLIntegerItem(0);
12132 LSL_List newrules = remaining.GetSublist(1, -1);
12133 foreach(SceneObjectPart part in GetLinkParts(obj, newLink)){
12134 remaining = SetPrimParams(part, newrules);
12135 }
12136 }
12147 } 12137 }
12148 12138
12149 public LSL_List GetLinkPrimitiveParamsEx(LSL_Key prim, LSL_List rules) 12139 public LSL_List GetLinkPrimitiveParamsEx(LSL_Key prim, LSL_List rules)