aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorMelanie2010-09-17 03:49:30 +0100
committerMelanie2010-09-17 03:49:30 +0100
commit7df438323576603344442e1350ed593e797ae3ae (patch)
tree2de03b8eaf5de93ba3305b0af8ae2616f9440d15 /OpenSim/Region/ScriptEngine/Shared
parentRevert "* Changed 11 calls for session info to the more optimized API method" (diff)
parentRevert "* Changed 11 calls for session info to the more optimized API method" (diff)
downloadopensim-SC_OLD-7df438323576603344442e1350ed593e797ae3ae.zip
opensim-SC_OLD-7df438323576603344442e1350ed593e797ae3ae.tar.gz
opensim-SC_OLD-7df438323576603344442e1350ed593e797ae3ae.tar.bz2
opensim-SC_OLD-7df438323576603344442e1350ed593e797ae3ae.tar.xz
Merge branch 'master' into careminster-presence-refactor
Integrate the next large patch. Don't use this version, it has a ghost avatar issue. Next push will fix it.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs56
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Helpers.cs11
2 files changed, 26 insertions, 41 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 0dd1787..caa39ba 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -294,8 +294,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
294 case ScriptBaseClass.LINK_SET: 294 case ScriptBaseClass.LINK_SET:
295 if (m_host.ParentGroup != null) 295 if (m_host.ParentGroup != null)
296 { 296 {
297 lock (m_host.ParentGroup.Children) 297 return new List<SceneObjectPart>(m_host.ParentGroup.Parts);
298 return new List<SceneObjectPart>(m_host.ParentGroup.Children.Values);
299 } 298 }
300 return ret; 299 return ret;
301 300
@@ -312,8 +311,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
312 if (m_host.ParentGroup == null) 311 if (m_host.ParentGroup == null)
313 return new List<SceneObjectPart>(); 312 return new List<SceneObjectPart>();
314 313
315 lock (m_host.ParentGroup.Children) 314 ret = new List<SceneObjectPart>(m_host.ParentGroup.Parts);
316 ret = new List<SceneObjectPart>(m_host.ParentGroup.Children.Values);
317 315
318 if (ret.Contains(m_host)) 316 if (ret.Contains(m_host))
319 ret.Remove(m_host); 317 ret.Remove(m_host);
@@ -323,8 +321,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
323 if (m_host.ParentGroup == null) 321 if (m_host.ParentGroup == null)
324 return new List<SceneObjectPart>(); 322 return new List<SceneObjectPart>();
325 323
326 lock (m_host.ParentGroup.Children) 324 ret = new List<SceneObjectPart>(m_host.ParentGroup.Parts);
327 ret = new List<SceneObjectPart>(m_host.ParentGroup.Children.Values);
328 325
329 if (ret.Contains(m_host.ParentGroup.RootPart)) 326 if (ret.Contains(m_host.ParentGroup.RootPart))
330 ret.Remove(m_host.ParentGroup.RootPart); 327 ret.Remove(m_host.ParentGroup.RootPart);
@@ -1281,16 +1278,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1281 if (group == null) 1278 if (group == null)
1282 return; 1279 return;
1283 bool allow = true; 1280 bool allow = true;
1284 1281
1285 lock (group.Children) 1282 foreach (SceneObjectPart part in group.Parts)
1286 { 1283 {
1287 foreach (SceneObjectPart part in group.Children.Values) 1284 if (part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys)
1288 { 1285 {
1289 if (part.Scale.X > World.m_maxPhys || part.Scale.Y > World.m_maxPhys || part.Scale.Z > World.m_maxPhys) 1286 allow = false;
1290 { 1287 break;
1291 allow = false;
1292 break;
1293 }
1294 } 1288 }
1295 } 1289 }
1296 1290
@@ -3889,18 +3883,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3889 case ScriptBaseClass.LINK_ALL_OTHERS: 3883 case ScriptBaseClass.LINK_ALL_OTHERS:
3890 case ScriptBaseClass.LINK_ALL_CHILDREN: 3884 case ScriptBaseClass.LINK_ALL_CHILDREN:
3891 case ScriptBaseClass.LINK_THIS: 3885 case ScriptBaseClass.LINK_THIS:
3892 lock (parentPrim.Children) 3886 foreach (SceneObjectPart part in parentPrim.Parts)
3893 { 3887 {
3894 foreach (SceneObjectPart part in parentPrim.Children.Values) 3888 if (part.UUID != m_host.UUID)
3895 { 3889 {
3896 if (part.UUID != m_host.UUID) 3890 childPrim = part;
3897 { 3891 break;
3898 childPrim = part;
3899 break;
3900 }
3901 } 3892 }
3902 break;
3903 } 3893 }
3894 break;
3904 default: 3895 default:
3905 childPrim = parentPrim.GetLinkNumPart(linknum); 3896 childPrim = parentPrim.GetLinkNumPart(linknum);
3906 if (childPrim.UUID == m_host.UUID) 3897 if (childPrim.UUID == m_host.UUID)
@@ -3911,7 +3902,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3911 if (linknum == ScriptBaseClass.LINK_ROOT) 3902 if (linknum == ScriptBaseClass.LINK_ROOT)
3912 { 3903 {
3913 // Restructuring Multiple Prims. 3904 // Restructuring Multiple Prims.
3914 List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Children.Values); 3905 List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Parts);
3915 parts.Remove(parentPrim.RootPart); 3906 parts.Remove(parentPrim.RootPart);
3916 if (parts.Count > 0) 3907 if (parts.Count > 0)
3917 { 3908 {
@@ -3976,19 +3967,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3976 if (parentPrim.RootPart.AttachmentPoint != 0) 3967 if (parentPrim.RootPart.AttachmentPoint != 0)
3977 return; // Fail silently if attached 3968 return; // Fail silently if attached
3978 3969
3979 lock (parentPrim.Children) 3970 List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Parts);
3971 parts.Remove(parentPrim.RootPart);
3972
3973 foreach (SceneObjectPart part in parts)
3980 { 3974 {
3981 List<SceneObjectPart> parts = new List<SceneObjectPart>(parentPrim.Children.Values); 3975 parentPrim.DelinkFromGroup(part.LocalId, true);
3982 parts.Remove(parentPrim.RootPart); 3976 parentPrim.TriggerScriptChangedEvent(Changed.LINK);
3983
3984 foreach (SceneObjectPart part in parts)
3985 {
3986 parentPrim.DelinkFromGroup(part.LocalId, true);
3987 parentPrim.TriggerScriptChangedEvent(Changed.LINK);
3988 }
3989 parentPrim.HasGroupChanged = true;
3990 parentPrim.ScheduleGroupForFullUpdate();
3991 } 3977 }
3978 parentPrim.HasGroupChanged = true;
3979 parentPrim.ScheduleGroupForFullUpdate();
3992 } 3980 }
3993 3981
3994 public LSL_String llGetLinkKey(int linknum) 3982 public LSL_String llGetLinkKey(int linknum)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
index 41501f2..3575889 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Helpers.cs
@@ -209,15 +209,12 @@ namespace OpenSim.Region.ScriptEngine.Shared
209 else 209 else
210 Type = 0x02; // Passive 210 Type = 0x02; // Passive
211 211
212 lock (part.ParentGroup.Children) 212 foreach (SceneObjectPart p in part.ParentGroup.Parts)
213 { 213 {
214 foreach (SceneObjectPart p in part.ParentGroup.Children.Values) 214 if (p.Inventory.ContainsScripts())
215 { 215 {
216 if (p.Inventory.ContainsScripts()) 216 Type |= 0x08; // Scripted
217 { 217 break;
218 Type |= 0x08; // Scripted
219 break;
220 }
221 } 218 }
222 } 219 }
223 220