aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rwxr-xr-xOpenSim/Region/Framework/Scenes/Scene.cs106
1 files changed, 53 insertions, 53 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 2137b42..5f99b73 100755
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2351,6 +2351,7 @@ namespace OpenSim.Region.Framework.Scenes
2351 EventManager.TriggerOnSceneObjectLoaded(group); 2351 EventManager.TriggerOnSceneObjectLoaded(group);
2352 SceneObjectPart rootPart = group.GetPart(group.UUID); 2352 SceneObjectPart rootPart = group.GetPart(group.UUID);
2353 rootPart.Flags &= ~PrimFlags.Scripted; 2353 rootPart.Flags &= ~PrimFlags.Scripted;
2354 group.AggregateDeepPerms();
2354 rootPart.TrimPermissions(); 2355 rootPart.TrimPermissions();
2355 2356
2356 // Don't do this here - it will get done later on when sculpt data is loaded. 2357 // Don't do this here - it will get done later on when sculpt data is loaded.
@@ -2603,8 +2604,8 @@ namespace OpenSim.Region.Framework.Scenes
2603 { 2604 {
2604 // Otherwise, use this default creation code; 2605 // Otherwise, use this default creation code;
2605 sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); 2606 sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape);
2606 AddNewSceneObject(sceneObject, true);
2607 sceneObject.SetGroup(groupID, null); 2607 sceneObject.SetGroup(groupID, null);
2608 AddNewSceneObject(sceneObject, true);
2608 2609
2609 if (AgentPreferencesService != null) // This will override the brave new full perm world! 2610 if (AgentPreferencesService != null) // This will override the brave new full perm world!
2610 { 2611 {
@@ -2622,6 +2623,7 @@ namespace OpenSim.Region.Framework.Scenes
2622 if (UserManagementModule != null) 2623 if (UserManagementModule != null)
2623 sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID); 2624 sceneObject.RootPart.CreatorIdentification = UserManagementModule.GetUserUUI(ownerID);
2624 2625
2626 sceneObject.AggregateDeepPerms();
2625 sceneObject.ScheduleGroupForFullUpdate(); 2627 sceneObject.ScheduleGroupForFullUpdate();
2626 2628
2627 return sceneObject; 2629 return sceneObject;
@@ -2768,7 +2770,7 @@ namespace OpenSim.Region.Framework.Scenes
2768 SceneObjectGroup sog = (SceneObjectGroup)e; 2770 SceneObjectGroup sog = (SceneObjectGroup)e;
2769 if (sog != null && !sog.IsAttachment) 2771 if (sog != null && !sog.IsAttachment)
2770 { 2772 {
2771 if (!exceptNoCopy || ((sog.GetEffectivePermissions() & (uint)PermissionMask.Copy) != 0)) 2773 if (!exceptNoCopy || ((sog.EffectiveOwnerPerms & (uint)PermissionMask.Copy) != 0))
2772 { 2774 {
2773 DeleteSceneObject((SceneObjectGroup)e, false); 2775 DeleteSceneObject((SceneObjectGroup)e, false);
2774 } 2776 }
@@ -2782,7 +2784,7 @@ namespace OpenSim.Region.Framework.Scenes
2782 } 2784 }
2783 if (toReturn.Count > 0) 2785 if (toReturn.Count > 0)
2784 { 2786 {
2785 returnObjects(toReturn.ToArray(), UUID.Zero); 2787 returnObjects(toReturn.ToArray(), null);
2786 } 2788 }
2787 } 2789 }
2788 2790
@@ -3603,7 +3605,9 @@ namespace OpenSim.Region.Framework.Scenes
3603 /// <param name="GroupID">Group of new object</param> 3605 /// <param name="GroupID">Group of new object</param>
3604 public void DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID) 3606 public void DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID)
3605 { 3607 {
3606 SceneObjectGroup copy = SceneGraph.DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Identity); 3608 bool createSelected = (flags & (uint)PrimFlags.CreateSelected) != 0;
3609 SceneObjectGroup copy = SceneGraph.DuplicateObject(originalPrim, offset, AgentID,
3610 GroupID, Quaternion.Identity, createSelected);
3607 if (copy != null) 3611 if (copy != null)
3608 EventManager.TriggerObjectAddedToScene(copy); 3612 EventManager.TriggerObjectAddedToScene(copy);
3609 } 3613 }
@@ -3633,6 +3637,8 @@ namespace OpenSim.Region.Framework.Scenes
3633 SceneObjectPart target = GetSceneObjectPart(localID); 3637 SceneObjectPart target = GetSceneObjectPart(localID);
3634 SceneObjectPart target2 = GetSceneObjectPart(RayTargetObj); 3638 SceneObjectPart target2 = GetSceneObjectPart(RayTargetObj);
3635 3639
3640 bool createSelected = (dupeFlags & (uint)PrimFlags.CreateSelected) != 0;
3641
3636 if (target != null && target2 != null) 3642 if (target != null && target2 != null)
3637 { 3643 {
3638 Vector3 direction = Vector3.Normalize(RayEnd - RayStart); 3644 Vector3 direction = Vector3.Normalize(RayEnd - RayStart);
@@ -3674,13 +3680,13 @@ namespace OpenSim.Region.Framework.Scenes
3674 Quaternion worldRot = target2.GetWorldRotation(); 3680 Quaternion worldRot = target2.GetWorldRotation();
3675 3681
3676 // SceneObjectGroup obj = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); 3682 // SceneObjectGroup obj = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot);
3677 copy = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); 3683 copy = m_sceneGraph.DuplicateObject(localID, pos, AgentID, GroupID, worldRot, createSelected);
3678 //obj.Rotation = worldRot; 3684 //obj.Rotation = worldRot;
3679 //obj.UpdateGroupRotationR(worldRot); 3685 //obj.UpdateGroupRotationR(worldRot);
3680 } 3686 }
3681 else 3687 else
3682 { 3688 {
3683 copy = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, Quaternion.Identity); 3689 copy = m_sceneGraph.DuplicateObject(localID, pos, AgentID, GroupID, Quaternion.Identity, createSelected);
3684 } 3690 }
3685 3691
3686 if (copy != null) 3692 if (copy != null)
@@ -5077,65 +5083,59 @@ Label_GroupsDone:
5077 #endregion 5083 #endregion
5078 5084
5079 #region Script Engine 5085 #region Script Engine
5080 5086 public bool LSLScriptDanger(SceneObjectPart part, Vector3 pos)
5081 private bool ScriptDanger(SceneObjectPart part, Vector3 pos)
5082 { 5087 {
5088
5083 ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y); 5089 ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y);
5084 if (part != null) 5090 if (parcel == null)
5085 { 5091 return true;
5086 if (parcel != null) 5092
5087 { 5093 LandData ldata = parcel.LandData;
5088 if ((parcel.LandData.Flags & (uint)ParcelFlags.AllowOtherScripts) != 0) 5094 if (ldata == null)
5089 { 5095 return true;
5090 return true; 5096
5091 } 5097 uint landflags = ldata.Flags;
5092 else if ((part.OwnerID == parcel.LandData.OwnerID) || Permissions.IsGod(part.OwnerID)) 5098
5093 { 5099 uint mask = (uint)(ParcelFlags.CreateObjects | ParcelFlags.AllowAPrimitiveEntry);
5094 return true; 5100 if((landflags & mask) != mask)
5095 } 5101 return true;
5096 else if (((parcel.LandData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0) 5102
5097 && (parcel.LandData.GroupID != UUID.Zero) && (parcel.LandData.GroupID == part.GroupID)) 5103 if((landflags & (uint)ParcelFlags.AllowOtherScripts) != 0)
5098 { 5104 return false;
5099 return true;
5100 }
5101 else
5102 {
5103 return false;
5104 }
5105 }
5106 else
5107 {
5108 5105
5109 if (pos.X > 0f && pos.X < RegionInfo.RegionSizeX && pos.Y > 0f && pos.Y < RegionInfo.RegionSizeY) 5106 if(part == null)
5110 { 5107 return true;
5111 // The only time parcel != null when an object is inside a region is when 5108 if(part.GroupID == ldata.GroupID && (landflags & (uint)ParcelFlags.AllowGroupScripts) != 0)
5112 // there is nothing behind the landchannel. IE, no land plugin loaded.
5113 return true;
5114 }
5115 else
5116 {
5117 // The object is outside of this region. Stop piping events to it.
5118 return false;
5119 }
5120 }
5121 }
5122 else
5123 {
5124 return false; 5109 return false;
5125 } 5110
5111 return true;
5126 } 5112 }
5127 5113
5128 public bool ScriptDanger(uint localID, Vector3 pos) 5114 private bool ScriptDanger(SceneObjectPart part, Vector3 pos)
5129 { 5115 {
5130 SceneObjectPart part = GetSceneObjectPart(localID); 5116 if (part == null)
5131 if (part != null) 5117 return false;
5118
5119 ILandObject parcel = LandChannel.GetLandObject(pos.X, pos.Y);
5120 if (parcel != null)
5132 { 5121 {
5133 return ScriptDanger(part, pos); 5122 if ((parcel.LandData.Flags & (uint)ParcelFlags.AllowOtherScripts) != 0)
5123 return true;
5124
5125 if ((part.OwnerID == parcel.LandData.OwnerID) || Permissions.IsGod(part.OwnerID))
5126 return true;
5127
5128 if (((parcel.LandData.Flags & (uint)ParcelFlags.AllowGroupScripts) != 0)
5129 && (parcel.LandData.GroupID != UUID.Zero) && (parcel.LandData.GroupID == part.GroupID))
5130 return true;
5134 } 5131 }
5135 else 5132 else
5136 { 5133 {
5137 return false; 5134 if (pos.X > 0f && pos.X < RegionInfo.RegionSizeX && pos.Y > 0f && pos.Y < RegionInfo.RegionSizeY)
5135 return true;
5138 } 5136 }
5137
5138 return false;
5139 } 5139 }
5140 5140
5141 public bool PipeEventsForScript(uint localID) 5141 public bool PipeEventsForScript(uint localID)