diff options
Diffstat (limited to 'OpenSim/Region/Framework')
4 files changed, 53 insertions, 32 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 057ca17..f29cdf4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1209,10 +1209,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1209 | 1209 | ||
1210 | if (group.GetInventoryItem(localID, itemID) != null) | 1210 | if (group.GetInventoryItem(localID, itemID) != null) |
1211 | { | 1211 | { |
1212 | if (item.Type == 10) | 1212 | if (item.Type == (int)InventoryType.LSL) |
1213 | { | 1213 | { |
1214 | part.RemoveScriptEvents(itemID); | 1214 | part.RemoveScriptEvents(itemID); |
1215 | EventManager.TriggerRemoveScript(localID, itemID); | 1215 | part.ParentGroup.AddActiveScriptCount(-1); |
1216 | } | 1216 | } |
1217 | 1217 | ||
1218 | group.RemoveInventoryItem(localID, itemID); | 1218 | group.RemoveInventoryItem(localID, itemID); |
@@ -1317,7 +1317,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1317 | if (taskItem.Type == (int)AssetType.LSLText) | 1317 | if (taskItem.Type == (int)AssetType.LSLText) |
1318 | { | 1318 | { |
1319 | part.RemoveScriptEvents(itemId); | 1319 | part.RemoveScriptEvents(itemId); |
1320 | EventManager.TriggerRemoveScript(part.LocalId, itemId); | 1320 | part.ParentGroup.AddActiveScriptCount(-1); |
1321 | } | 1321 | } |
1322 | 1322 | ||
1323 | part.Inventory.RemoveInventoryItem(itemId); | 1323 | part.Inventory.RemoveInventoryItem(itemId); |
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..532263a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2579,8 +2579,30 @@ 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 | |||
2587 | // same as above but called during group Effective Permission validation | ||
2588 | public void AggregatedInnerPermsForGroup() | ||
2589 | { | ||
2590 | // assuming child prims permissions masks are irrelevant on a linkset | ||
2591 | // root part is handle at SOG since its masks are the sog masks | ||
2592 | const uint mask = (uint)PermissionMask.AllEffective; | ||
2593 | |||
2594 | uint owner = mask; | ||
2595 | uint group = mask; | ||
2596 | uint everyone = mask; | ||
2597 | |||
2598 | lock(InnerPermsLock) // do we really need this? | ||
2599 | { | ||
2600 | if(Inventory != null) | ||
2601 | Inventory.AggregateInnerPerms(ref owner, ref group, ref everyone); | ||
2602 | |||
2603 | AggregatedInnerOwnerPerms = owner & mask; | ||
2604 | AggregatedInnerGroupPerms = group & mask; | ||
2605 | AggregatedInnerEveryonePerms = everyone & mask; | ||
2584 | } | 2606 | } |
2585 | } | 2607 | } |
2586 | 2608 | ||
@@ -3817,7 +3839,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
3817 | Byte[] buf = Shape.Textures.GetBytes(); | 3839 | Byte[] buf = Shape.Textures.GetBytes(); |
3818 | Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length); | 3840 | Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length); |
3819 | Color4 texcolor; | 3841 | Color4 texcolor; |
3820 | if (face >= 0 && face < GetNumberOfSides()) | 3842 | int nsides = GetNumberOfSides(); |
3843 | if (face >= 0 && face < nsides) | ||
3821 | { | 3844 | { |
3822 | texcolor = tex.CreateFace((uint)face).RGBA; | 3845 | texcolor = tex.CreateFace((uint)face).RGBA; |
3823 | texcolor.R = clippedColor.X; | 3846 | texcolor.R = clippedColor.X; |
@@ -3833,7 +3856,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3833 | } | 3856 | } |
3834 | else if (face == ALL_SIDES) | 3857 | else if (face == ALL_SIDES) |
3835 | { | 3858 | { |
3836 | for (uint i = 0; i < GetNumberOfSides(); i++) | 3859 | for (uint i = 0; i < nsides; i++) |
3837 | { | 3860 | { |
3838 | if (tex.FaceTextures[i] != null) | 3861 | if (tex.FaceTextures[i] != null) |
3839 | { | 3862 | { |
@@ -5138,20 +5161,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
5138 | 5161 | ||
5139 | Changed changeFlags = 0; | 5162 | Changed changeFlags = 0; |
5140 | 5163 | ||
5141 | Primitive.TextureEntryFace fallbackNewFace = newTex.DefaultTexture; | 5164 | Primitive.TextureEntryFace defaultNewFace = newTex.DefaultTexture; |
5142 | Primitive.TextureEntryFace fallbackOldFace = oldTex.DefaultTexture; | 5165 | Primitive.TextureEntryFace defaultOldFace = oldTex.DefaultTexture; |
5143 | 5166 | ||
5144 | // On Incoming packets, sometimes newText.DefaultTexture is null. The assumption is that all | 5167 | // 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. | 5168 | // 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) | 5169 | if (defaultNewFace == null) |
5147 | { | 5170 | { |
5148 | fallbackNewFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0); | 5171 | defaultNewFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0); |
5149 | newTex.DefaultTexture = fallbackNewFace; | 5172 | newTex.DefaultTexture = defaultNewFace; |
5150 | } | 5173 | } |
5151 | if (fallbackOldFace == null) | 5174 | if (defaultOldFace == null) |
5152 | { | 5175 | { |
5153 | fallbackOldFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0); | 5176 | defaultOldFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0); |
5154 | oldTex.DefaultTexture = fallbackOldFace; | 5177 | oldTex.DefaultTexture = defaultOldFace; |
5155 | } | 5178 | } |
5156 | 5179 | ||
5157 | // Materials capable viewers can send a ObjectImage packet | 5180 | // Materials capable viewers can send a ObjectImage packet |
@@ -5161,13 +5184,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
5161 | // we should ignore any changes and not update Shape.TextureEntry | 5184 | // we should ignore any changes and not update Shape.TextureEntry |
5162 | 5185 | ||
5163 | bool otherFieldsChanged = false; | 5186 | bool otherFieldsChanged = false; |
5164 | 5187 | int nsides = GetNumberOfSides(); | |
5165 | for (int i = 0 ; i < GetNumberOfSides(); i++) | 5188 | for (int i = 0 ; i < nsides; i++) |
5166 | { | 5189 | { |
5167 | 5190 | Primitive.TextureEntryFace newFace = defaultNewFace; | |
5168 | Primitive.TextureEntryFace newFace = newTex.DefaultTexture; | 5191 | Primitive.TextureEntryFace oldFace = defaultOldFace; |
5169 | Primitive.TextureEntryFace oldFace = oldTex.DefaultTexture; | ||
5170 | |||
5171 | if (oldTex.FaceTextures[i] != null) | 5192 | if (oldTex.FaceTextures[i] != null) |
5172 | oldFace = oldTex.FaceTextures[i]; | 5193 | oldFace = oldTex.FaceTextures[i]; |
5173 | if (newTex.FaceTextures[i] != null) | 5194 | if (newTex.FaceTextures[i] != null) |
@@ -5202,17 +5223,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
5202 | if (oldFace.Rotation != newFace.Rotation) otherFieldsChanged = true; | 5223 | if (oldFace.Rotation != newFace.Rotation) otherFieldsChanged = true; |
5203 | if (oldFace.Shiny != newFace.Shiny) otherFieldsChanged = true; | 5224 | if (oldFace.Shiny != newFace.Shiny) otherFieldsChanged = true; |
5204 | if (oldFace.TexMapType != newFace.TexMapType) otherFieldsChanged = true; | 5225 | if (oldFace.TexMapType != newFace.TexMapType) otherFieldsChanged = true; |
5226 | if(otherFieldsChanged) | ||
5227 | changeFlags |= Changed.TEXTURE; | ||
5205 | } | 5228 | } |
5206 | } | 5229 | } |
5207 | 5230 | ||
5208 | if (changeFlags != 0 || otherFieldsChanged) | 5231 | if (changeFlags == 0) |
5209 | { | 5232 | return; |
5210 | m_shape.TextureEntry = newTex.GetBytes(); | 5233 | m_shape.TextureEntry = newTex.GetBytes(); |
5211 | if (changeFlags != 0) | 5234 | TriggerScriptChangedEvent(changeFlags); |
5212 | TriggerScriptChangedEvent(changeFlags); | 5235 | ParentGroup.HasGroupChanged = true; |
5213 | ParentGroup.HasGroupChanged = true; | 5236 | ScheduleFullUpdate(); |
5214 | ScheduleFullUpdate(); | ||
5215 | } | ||
5216 | } | 5237 | } |
5217 | 5238 | ||
5218 | internal void UpdatePhysicsSubscribedEvents() | 5239 | internal void UpdatePhysicsSubscribedEvents() |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index d8f2b80..b22bda0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -1081,7 +1081,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1081 | { | 1081 | { |
1082 | int type = m_items[itemID].InvType; | 1082 | int type = m_items[itemID].InvType; |
1083 | m_items.LockItemsForRead(false); | 1083 | m_items.LockItemsForRead(false); |
1084 | if (type == 10) // Script | 1084 | if (type == (int)InventoryType.LSL) // Script |
1085 | { | 1085 | { |
1086 | m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID); | 1086 | m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID); |
1087 | } | 1087 | } |
@@ -1101,7 +1101,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1101 | m_items.LockItemsForRead(true); | 1101 | m_items.LockItemsForRead(true); |
1102 | foreach (TaskInventoryItem item in m_items.Values) | 1102 | foreach (TaskInventoryItem item in m_items.Values) |
1103 | { | 1103 | { |
1104 | if (item.Type == 10) | 1104 | if (item.Type == (int)InventoryType.LSL) |
1105 | { | 1105 | { |
1106 | scriptcount++; | 1106 | scriptcount++; |
1107 | } | 1107 | } |