aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs71
2 files changed, 46 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
index f778367..bf217a5 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs
@@ -358,7 +358,7 @@ namespace OpenSim.Region.Framework.Scenes
358 SceneObjectPart part = parts[i]; 358 SceneObjectPart part = parts[i];
359 359
360 if(m_DeepEffectivePermsInvalid) 360 if(m_DeepEffectivePermsInvalid)
361 part.AggregateInnerPerms(); 361 part.AggregatedInnerPermsForGroup();
362 362
363 owner &= part.AggregatedInnerOwnerPerms; 363 owner &= part.AggregatedInnerOwnerPerms;
364 group &= part.AggregatedInnerGroupPerms; 364 group &= part.AggregatedInnerGroupPerms;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 7bde7c0..350b9cf 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2579,8 +2579,29 @@ namespace OpenSim.Region.Framework.Scenes
2579 AggregatedInnerOwnerPerms = owner & mask; 2579 AggregatedInnerOwnerPerms = owner & mask;
2580 AggregatedInnerGroupPerms = group & mask; 2580 AggregatedInnerGroupPerms = group & mask;
2581 AggregatedInnerEveryonePerms = everyone & mask; 2581 AggregatedInnerEveryonePerms = everyone & mask;
2582 if(ParentGroup != null) 2582 }
2583 ParentGroup.InvalidateEffectivePerms(); 2583 if(ParentGroup != null)
2584 ParentGroup.InvalidateEffectivePerms();
2585 }
2586 // same as above but called during group Effective Permission validation
2587 public void AggregatedInnerPermsForGroup()
2588 {
2589 // assuming child prims permissions masks are irrelevant on a linkset
2590 // root part is handle at SOG since its masks are the sog masks
2591 const uint mask = (uint)PermissionMask.AllEffective;
2592
2593 uint owner = mask;
2594 uint group = mask;
2595 uint everyone = mask;
2596
2597 lock(InnerPermsLock) // do we really need this?
2598 {
2599 if(Inventory != null)
2600 Inventory.AggregateInnerPerms(ref owner, ref group, ref everyone);
2601
2602 AggregatedInnerOwnerPerms = owner & mask;
2603 AggregatedInnerGroupPerms = group & mask;
2604 AggregatedInnerEveryonePerms = everyone & mask;
2584 } 2605 }
2585 } 2606 }
2586 2607
@@ -3817,7 +3838,8 @@ namespace OpenSim.Region.Framework.Scenes
3817 Byte[] buf = Shape.Textures.GetBytes(); 3838 Byte[] buf = Shape.Textures.GetBytes();
3818 Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length); 3839 Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length);
3819 Color4 texcolor; 3840 Color4 texcolor;
3820 if (face >= 0 && face < GetNumberOfSides()) 3841 int nsides = GetNumberOfSides();
3842 if (face >= 0 && face < nsides)
3821 { 3843 {
3822 texcolor = tex.CreateFace((uint)face).RGBA; 3844 texcolor = tex.CreateFace((uint)face).RGBA;
3823 texcolor.R = clippedColor.X; 3845 texcolor.R = clippedColor.X;
@@ -3833,7 +3855,7 @@ namespace OpenSim.Region.Framework.Scenes
3833 } 3855 }
3834 else if (face == ALL_SIDES) 3856 else if (face == ALL_SIDES)
3835 { 3857 {
3836 for (uint i = 0; i < GetNumberOfSides(); i++) 3858 for (uint i = 0; i < nsides; i++)
3837 { 3859 {
3838 if (tex.FaceTextures[i] != null) 3860 if (tex.FaceTextures[i] != null)
3839 { 3861 {
@@ -5138,20 +5160,20 @@ namespace OpenSim.Region.Framework.Scenes
5138 5160
5139 Changed changeFlags = 0; 5161 Changed changeFlags = 0;
5140 5162
5141 Primitive.TextureEntryFace fallbackNewFace = newTex.DefaultTexture; 5163 Primitive.TextureEntryFace defaultNewFace = newTex.DefaultTexture;
5142 Primitive.TextureEntryFace fallbackOldFace = oldTex.DefaultTexture; 5164 Primitive.TextureEntryFace defaultOldFace = oldTex.DefaultTexture;
5143 5165
5144 // On Incoming packets, sometimes newText.DefaultTexture is null. The assumption is that all 5166 // On Incoming packets, sometimes newText.DefaultTexture is null. The assumption is that all
5145 // other prim-sides are set, but apparently that's not always the case. Lets assume packet/data corruption at this point. 5167 // other prim-sides are set, but apparently that's not always the case. Lets assume packet/data corruption at this point.
5146 if (fallbackNewFace == null) 5168 if (defaultNewFace == null)
5147 { 5169 {
5148 fallbackNewFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0); 5170 defaultNewFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0);
5149 newTex.DefaultTexture = fallbackNewFace; 5171 newTex.DefaultTexture = defaultNewFace;
5150 } 5172 }
5151 if (fallbackOldFace == null) 5173 if (defaultOldFace == null)
5152 { 5174 {
5153 fallbackOldFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0); 5175 defaultOldFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0);
5154 oldTex.DefaultTexture = fallbackOldFace; 5176 oldTex.DefaultTexture = defaultOldFace;
5155 } 5177 }
5156 5178
5157 // Materials capable viewers can send a ObjectImage packet 5179 // Materials capable viewers can send a ObjectImage packet
@@ -5161,13 +5183,11 @@ namespace OpenSim.Region.Framework.Scenes
5161 // we should ignore any changes and not update Shape.TextureEntry 5183 // we should ignore any changes and not update Shape.TextureEntry
5162 5184
5163 bool otherFieldsChanged = false; 5185 bool otherFieldsChanged = false;
5164 5186 int nsides = GetNumberOfSides();
5165 for (int i = 0 ; i < GetNumberOfSides(); i++) 5187 for (int i = 0 ; i < nsides; i++)
5166 { 5188 {
5167 5189 Primitive.TextureEntryFace newFace = defaultNewFace;
5168 Primitive.TextureEntryFace newFace = newTex.DefaultTexture; 5190 Primitive.TextureEntryFace oldFace = defaultOldFace;
5169 Primitive.TextureEntryFace oldFace = oldTex.DefaultTexture;
5170
5171 if (oldTex.FaceTextures[i] != null) 5191 if (oldTex.FaceTextures[i] != null)
5172 oldFace = oldTex.FaceTextures[i]; 5192 oldFace = oldTex.FaceTextures[i];
5173 if (newTex.FaceTextures[i] != null) 5193 if (newTex.FaceTextures[i] != null)
@@ -5202,17 +5222,16 @@ namespace OpenSim.Region.Framework.Scenes
5202 if (oldFace.Rotation != newFace.Rotation) otherFieldsChanged = true; 5222 if (oldFace.Rotation != newFace.Rotation) otherFieldsChanged = true;
5203 if (oldFace.Shiny != newFace.Shiny) otherFieldsChanged = true; 5223 if (oldFace.Shiny != newFace.Shiny) otherFieldsChanged = true;
5204 if (oldFace.TexMapType != newFace.TexMapType) otherFieldsChanged = true; 5224 if (oldFace.TexMapType != newFace.TexMapType) otherFieldsChanged = true;
5225 if(otherFieldsChanged)
5226 changeFlags |= Changed.TEXTURE;
5205 } 5227 }
5206 } 5228 }
5207 5229
5208 if (changeFlags != 0 || otherFieldsChanged) 5230 m_shape.TextureEntry = newTex.GetBytes();
5209 { 5231 if (changeFlags != 0)
5210 m_shape.TextureEntry = newTex.GetBytes(); 5232 TriggerScriptChangedEvent(changeFlags);
5211 if (changeFlags != 0) 5233 ParentGroup.HasGroupChanged = true;
5212 TriggerScriptChangedEvent(changeFlags); 5234 ScheduleFullUpdate();
5213 ParentGroup.HasGroupChanged = true;
5214 ScheduleFullUpdate();
5215 }
5216 } 5235 }
5217 5236
5218 internal void UpdatePhysicsSubscribedEvents() 5237 internal void UpdatePhysicsSubscribedEvents()