Merge branch 'master' into httptests

This commit is contained in:
UbitUmarov
2017-11-12 03:18:02 +00:00
8 changed files with 391 additions and 54 deletions

View File

@@ -1209,10 +1209,10 @@ namespace OpenSim.Region.Framework.Scenes
if (group.GetInventoryItem(localID, itemID) != null)
{
if (item.Type == 10)
if (item.Type == (int)InventoryType.LSL)
{
part.RemoveScriptEvents(itemID);
EventManager.TriggerRemoveScript(localID, itemID);
part.ParentGroup.AddActiveScriptCount(-1);
}
group.RemoveInventoryItem(localID, itemID);
@@ -1317,7 +1317,7 @@ namespace OpenSim.Region.Framework.Scenes
if (taskItem.Type == (int)AssetType.LSLText)
{
part.RemoveScriptEvents(itemId);
EventManager.TriggerRemoveScript(part.LocalId, itemId);
part.ParentGroup.AddActiveScriptCount(-1);
}
part.Inventory.RemoveInventoryItem(itemId);

View File

@@ -358,7 +358,7 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectPart part = parts[i];
if(m_DeepEffectivePermsInvalid)
part.AggregateInnerPerms();
part.AggregatedInnerPermsForGroup();
owner &= part.AggregatedInnerOwnerPerms;
group &= part.AggregatedInnerGroupPerms;

View File

@@ -2579,8 +2579,30 @@ namespace OpenSim.Region.Framework.Scenes
AggregatedInnerOwnerPerms = owner & mask;
AggregatedInnerGroupPerms = group & mask;
AggregatedInnerEveryonePerms = everyone & mask;
if(ParentGroup != null)
ParentGroup.InvalidateEffectivePerms();
}
if(ParentGroup != null)
ParentGroup.InvalidateEffectivePerms();
}
// same as above but called during group Effective Permission validation
public void AggregatedInnerPermsForGroup()
{
// assuming child prims permissions masks are irrelevant on a linkset
// root part is handle at SOG since its masks are the sog masks
const uint mask = (uint)PermissionMask.AllEffective;
uint owner = mask;
uint group = mask;
uint everyone = mask;
lock(InnerPermsLock) // do we really need this?
{
if(Inventory != null)
Inventory.AggregateInnerPerms(ref owner, ref group, ref everyone);
AggregatedInnerOwnerPerms = owner & mask;
AggregatedInnerGroupPerms = group & mask;
AggregatedInnerEveryonePerms = everyone & mask;
}
}
@@ -3817,7 +3839,8 @@ namespace OpenSim.Region.Framework.Scenes
Byte[] buf = Shape.Textures.GetBytes();
Primitive.TextureEntry tex = new Primitive.TextureEntry(buf, 0, buf.Length);
Color4 texcolor;
if (face >= 0 && face < GetNumberOfSides())
int nsides = GetNumberOfSides();
if (face >= 0 && face < nsides)
{
texcolor = tex.CreateFace((uint)face).RGBA;
texcolor.R = clippedColor.X;
@@ -3833,7 +3856,7 @@ namespace OpenSim.Region.Framework.Scenes
}
else if (face == ALL_SIDES)
{
for (uint i = 0; i < GetNumberOfSides(); i++)
for (uint i = 0; i < nsides; i++)
{
if (tex.FaceTextures[i] != null)
{
@@ -5138,20 +5161,20 @@ namespace OpenSim.Region.Framework.Scenes
Changed changeFlags = 0;
Primitive.TextureEntryFace fallbackNewFace = newTex.DefaultTexture;
Primitive.TextureEntryFace fallbackOldFace = oldTex.DefaultTexture;
Primitive.TextureEntryFace defaultNewFace = newTex.DefaultTexture;
Primitive.TextureEntryFace defaultOldFace = oldTex.DefaultTexture;
// On Incoming packets, sometimes newText.DefaultTexture is null. The assumption is that all
// other prim-sides are set, but apparently that's not always the case. Lets assume packet/data corruption at this point.
if (fallbackNewFace == null)
if (defaultNewFace == null)
{
fallbackNewFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0);
newTex.DefaultTexture = fallbackNewFace;
defaultNewFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0);
newTex.DefaultTexture = defaultNewFace;
}
if (fallbackOldFace == null)
if (defaultOldFace == null)
{
fallbackOldFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0);
oldTex.DefaultTexture = fallbackOldFace;
defaultOldFace = new Primitive.TextureEntry(Util.BLANK_TEXTURE_UUID).CreateFace(0);
oldTex.DefaultTexture = defaultOldFace;
}
// Materials capable viewers can send a ObjectImage packet
@@ -5161,13 +5184,11 @@ namespace OpenSim.Region.Framework.Scenes
// we should ignore any changes and not update Shape.TextureEntry
bool otherFieldsChanged = false;
for (int i = 0 ; i < GetNumberOfSides(); i++)
int nsides = GetNumberOfSides();
for (int i = 0 ; i < nsides; i++)
{
Primitive.TextureEntryFace newFace = newTex.DefaultTexture;
Primitive.TextureEntryFace oldFace = oldTex.DefaultTexture;
Primitive.TextureEntryFace newFace = defaultNewFace;
Primitive.TextureEntryFace oldFace = defaultOldFace;
if (oldTex.FaceTextures[i] != null)
oldFace = oldTex.FaceTextures[i];
if (newTex.FaceTextures[i] != null)
@@ -5202,17 +5223,17 @@ namespace OpenSim.Region.Framework.Scenes
if (oldFace.Rotation != newFace.Rotation) otherFieldsChanged = true;
if (oldFace.Shiny != newFace.Shiny) otherFieldsChanged = true;
if (oldFace.TexMapType != newFace.TexMapType) otherFieldsChanged = true;
if(otherFieldsChanged)
changeFlags |= Changed.TEXTURE;
}
}
if (changeFlags != 0 || otherFieldsChanged)
{
m_shape.TextureEntry = newTex.GetBytes();
if (changeFlags != 0)
TriggerScriptChangedEvent(changeFlags);
ParentGroup.HasGroupChanged = true;
ScheduleFullUpdate();
}
if (changeFlags == 0)
return;
m_shape.TextureEntry = newTex.GetBytes();
TriggerScriptChangedEvent(changeFlags);
ParentGroup.HasGroupChanged = true;
ScheduleFullUpdate();
}
internal void UpdatePhysicsSubscribedEvents()

View File

@@ -1081,7 +1081,7 @@ namespace OpenSim.Region.Framework.Scenes
{
int type = m_items[itemID].InvType;
m_items.LockItemsForRead(false);
if (type == 10) // Script
if (type == (int)InventoryType.LSL) // Script
{
m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID);
}
@@ -1101,7 +1101,7 @@ namespace OpenSim.Region.Framework.Scenes
m_items.LockItemsForRead(true);
foreach (TaskInventoryItem item in m_items.Values)
{
if (item.Type == 10)
if (item.Type == (int)InventoryType.LSL)
{
scriptcount++;
}