* changed nonsensical PermissionMask and ObjectFlags mixup; if this causes perms weirdness, let's all work together to find the real cause.
parent
af43349294
commit
8d0364e228
|
@ -754,7 +754,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
AddEntity(group);
|
AddEntity(group);
|
||||||
group.AbsolutePosition = pos;
|
group.AbsolutePosition = pos;
|
||||||
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
|
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
|
||||||
rootPart.ApplySanePermissions();
|
rootPart.TrimPermissions();
|
||||||
group.ApplyPhysics(m_physicalPrim);
|
group.ApplyPhysics(m_physicalPrim);
|
||||||
group.StartScripts();
|
group.StartScripts();
|
||||||
|
|
||||||
|
|
|
@ -933,7 +933,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
AddEntityFromStorage(group);
|
AddEntityFromStorage(group);
|
||||||
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
|
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
|
||||||
rootPart.ApplySanePermissions();
|
rootPart.TrimPermissions();
|
||||||
|
|
||||||
group.ApplyPhysics(m_physicalPrim);
|
group.ApplyPhysics(m_physicalPrim);
|
||||||
//rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
|
//rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
|
||||||
|
@ -1065,7 +1065,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
AddEntity(sceneOb);
|
AddEntity(sceneOb);
|
||||||
SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
|
SceneObjectPart rootPart = sceneOb.GetChildPart(sceneOb.UUID);
|
||||||
// if grass or tree, make phantom
|
// if grass or tree, make phantom
|
||||||
//rootPart.ApplySanePermissions();
|
//rootPart.TrimPermissions();
|
||||||
if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255) || (rootPart.Shape.PCode == 111))
|
if ((rootPart.Shape.PCode == 95) || (rootPart.Shape.PCode == 255) || (rootPart.Shape.PCode == 111))
|
||||||
{
|
{
|
||||||
rootPart.AddFlag(LLObject.ObjectFlags.Phantom);
|
rootPart.AddFlag(LLObject.ObjectFlags.Phantom);
|
||||||
|
|
|
@ -288,7 +288,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
AddPart(part);
|
AddPart(part);
|
||||||
part.RegionHandle = m_regionHandle;
|
part.RegionHandle = m_regionHandle;
|
||||||
|
|
||||||
part.ApplySanePermissions();
|
part.TrimPermissions();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case XmlNodeType.EndElement:
|
case XmlNodeType.EndElement:
|
||||||
|
@ -524,7 +524,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
dupe.m_regionHandle = m_regionHandle;
|
dupe.m_regionHandle = m_regionHandle;
|
||||||
|
|
||||||
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID);
|
dupe.CopyRootPart(m_rootPart, OwnerID, GroupID);
|
||||||
dupe.m_rootPart.ApplySanePermissions();
|
dupe.m_rootPart.TrimPermissions();
|
||||||
|
|
||||||
/// may need to create a new Physics actor.
|
/// may need to create a new Physics actor.
|
||||||
if (dupe.RootPart.PhysActor != null)
|
if (dupe.RootPart.PhysActor != null)
|
||||||
|
|
|
@ -61,18 +61,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public partial class SceneObjectPart : IScriptHost
|
public partial class SceneObjectPart : IScriptHost
|
||||||
{
|
{
|
||||||
private const PermissionMask OBJFULL_MASK_GENERAL =
|
|
||||||
PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer | PermissionMask.Move;
|
|
||||||
|
|
||||||
private const PermissionMask OBJFULL_MASK_OWNER =
|
|
||||||
PermissionMask.Copy | PermissionMask.Modify |
|
|
||||||
PermissionMask.Transfer;
|
|
||||||
|
|
||||||
private const uint OBJNEXT_OWNER = 2147483647;
|
|
||||||
|
|
||||||
private const uint FULL_MASK_PERMISSIONS_GENERAL = 2147483647;
|
|
||||||
private const uint FULL_MASK_PERMISSIONS_OWNER = 2147483647;
|
|
||||||
|
|
||||||
[XmlIgnore] public PhysicsActor PhysActor = null;
|
[XmlIgnore] public PhysicsActor PhysActor = null;
|
||||||
|
|
||||||
public LLUUID LastOwnerID;
|
public LLUUID LastOwnerID;
|
||||||
|
@ -90,14 +78,23 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
private Quaternion m_sitTargetOrientation = new Quaternion(0, 0, 0, 1);
|
private Quaternion m_sitTargetOrientation = new Quaternion(0, 0, 0, 1);
|
||||||
private LLUUID m_SitTargetAvatar = LLUUID.Zero;
|
private LLUUID m_SitTargetAvatar = LLUUID.Zero;
|
||||||
|
|
||||||
//
|
#region Permissions
|
||||||
// Main grid has default permissions as follows
|
|
||||||
//
|
public uint BaseMask = (uint)PermissionMask.All;
|
||||||
public uint OwnerMask =(uint) PermissionMask.All;
|
public uint OwnerMask = (uint)PermissionMask.All;
|
||||||
public uint NextOwnerMask = OBJNEXT_OWNER;
|
public uint GroupMask = (uint)PermissionMask.None;
|
||||||
public uint GroupMask = (uint) PermissionMask.None;
|
|
||||||
public uint EveryoneMask = (uint)PermissionMask.None;
|
public uint EveryoneMask = (uint)PermissionMask.None;
|
||||||
public uint BaseMask = FULL_MASK_PERMISSIONS_OWNER;
|
public uint NextOwnerMask = (uint)PermissionMask.All;
|
||||||
|
|
||||||
|
public LLObject.ObjectFlags Flags = LLObject.ObjectFlags.None;
|
||||||
|
|
||||||
|
public uint ObjectFlags
|
||||||
|
{
|
||||||
|
get { return (uint)Flags; }
|
||||||
|
set { Flags = (LLObject.ObjectFlags)value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
protected byte[] m_particleSystem = new byte[0];
|
protected byte[] m_particleSystem = new byte[0];
|
||||||
|
|
||||||
|
@ -143,13 +140,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
set { m_name = value; }
|
set { m_name = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected LLObject.ObjectFlags m_flags = 0;
|
|
||||||
|
|
||||||
public uint ObjectFlags
|
|
||||||
{
|
|
||||||
get { return (uint) m_flags; }
|
|
||||||
set { m_flags = (LLObject.ObjectFlags) value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
protected LLObject.MaterialType m_material = 0;
|
protected LLObject.MaterialType m_material = 0;
|
||||||
|
|
||||||
|
@ -659,12 +650,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_inventoryFileName = "taskinventory" + LLUUID.Random().ToString();
|
m_inventoryFileName = "taskinventory" + LLUUID.Random().ToString();
|
||||||
m_folderID = LLUUID.Random();
|
m_folderID = LLUUID.Random();
|
||||||
|
|
||||||
m_flags = 0;
|
Flags = 0;
|
||||||
m_flags |= LLObject.ObjectFlags.Touch |
|
Flags |= LLObject.ObjectFlags.Touch |
|
||||||
LLObject.ObjectFlags.AllowInventoryDrop |
|
LLObject.ObjectFlags.AllowInventoryDrop |
|
||||||
LLObject.ObjectFlags.CreateSelected;
|
LLObject.ObjectFlags.CreateSelected;
|
||||||
|
|
||||||
ApplySanePermissions();
|
TrimPermissions();
|
||||||
|
|
||||||
ScheduleFullUpdate();
|
ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
|
@ -702,7 +693,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
RotationOffset = rotation;
|
RotationOffset = rotation;
|
||||||
ObjectFlags = flags;
|
ObjectFlags = flags;
|
||||||
|
|
||||||
ApplySanePermissions();
|
TrimPermissions();
|
||||||
// ApplyPhysics();
|
// ApplyPhysics();
|
||||||
|
|
||||||
ScheduleFullUpdate();
|
ScheduleFullUpdate();
|
||||||
|
@ -752,67 +743,18 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
BaseMask = NextOwnerMask;
|
BaseMask = NextOwnerMask;
|
||||||
OwnerMask = NextOwnerMask;
|
OwnerMask = NextOwnerMask;
|
||||||
|
|
||||||
TriggerScriptChangedEvent(Changed.OWNER);
|
TriggerScriptChangedEvent(Changed.OWNER);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ApplySanePermissions()
|
public void TrimPermissions()
|
||||||
{
|
{
|
||||||
// These are some flags that The OwnerMask should never have
|
BaseMask &= (uint)PermissionMask.All;
|
||||||
|
OwnerMask &= (uint)PermissionMask.All;
|
||||||
|
GroupMask &= (uint)PermissionMask.All;
|
||||||
// These are some flags that the next owner mask should never have
|
EveryoneMask &= (uint)PermissionMask.All;
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.ObjectYouOwner;
|
NextOwnerMask &= (uint)PermissionMask.All;
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.ObjectTransfer;
|
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.ObjectOwnerModify;
|
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.ObjectGroupOwned;
|
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.Physics;
|
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.Phantom;
|
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.Scripted;
|
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.Touch;
|
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.Temporary;
|
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.TemporaryOnRez;
|
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.ZlibCompressed;
|
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.AllowInventoryDrop;
|
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.AnimSource;
|
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.Money;
|
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.CastShadows;
|
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.InventoryEmpty;
|
|
||||||
NextOwnerMask &= ~(uint) LLObject.ObjectFlags.CreateSelected;
|
|
||||||
|
|
||||||
|
|
||||||
// These are some flags that the GroupMask should never have
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.ObjectYouOwner;
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.ObjectTransfer;
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.ObjectOwnerModify;
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.ObjectGroupOwned;
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.Physics;
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.Phantom;
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.Scripted;
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.Touch;
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.Temporary;
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.TemporaryOnRez;
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.ZlibCompressed;
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.AllowInventoryDrop;
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.AnimSource;
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.Money;
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.CastShadows;
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.InventoryEmpty;
|
|
||||||
GroupMask &= ~(uint) LLObject.ObjectFlags.CreateSelected;
|
|
||||||
|
|
||||||
|
|
||||||
// These are some flags that EveryoneMask should never have
|
|
||||||
//EveryoneMask = (uint)OBJFULL_MASK_EVERYONE;
|
|
||||||
|
|
||||||
|
|
||||||
// These are some flags that ObjectFlags (m_flags) should never have
|
|
||||||
ObjectFlags &= ~(uint) LLObject.ObjectFlags.ObjectYouOwner;
|
|
||||||
ObjectFlags &= ~(uint) LLObject.ObjectFlags.ObjectTransfer;
|
|
||||||
ObjectFlags &= ~(uint) LLObject.ObjectFlags.ObjectOwnerModify;
|
|
||||||
ObjectFlags &= ~(uint) LLObject.ObjectFlags.ObjectYouOfficer;
|
|
||||||
ObjectFlags &= ~(uint) LLObject.ObjectFlags.ObjectCopy;
|
|
||||||
ObjectFlags &= ~(uint) LLObject.ObjectFlags.ObjectModify;
|
|
||||||
ObjectFlags &= ~(uint) LLObject.ObjectFlags.ObjectMove;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -1097,27 +1039,27 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public void AddFlag(LLObject.ObjectFlags flag)
|
public void AddFlag(LLObject.ObjectFlags flag)
|
||||||
{
|
{
|
||||||
LLObject.ObjectFlags prevflag = m_flags;
|
LLObject.ObjectFlags prevflag = Flags;
|
||||||
//uint objflags = m_flags;
|
//uint objflags = Flags;
|
||||||
if ((ObjectFlags & (uint) flag) == 0)
|
if ((ObjectFlags & (uint) flag) == 0)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("Adding flag: " + ((LLObject.ObjectFlags) flag).ToString());
|
//Console.WriteLine("Adding flag: " + ((LLObject.ObjectFlags) flag).ToString());
|
||||||
m_flags |= flag;
|
Flags |= flag;
|
||||||
}
|
}
|
||||||
//uint currflag = (uint)m_flags;
|
//uint currflag = (uint)Flags;
|
||||||
//System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + m_flags.ToString());
|
//System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + Flags.ToString());
|
||||||
//ScheduleFullUpdate();
|
//ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemFlag(LLObject.ObjectFlags flag)
|
public void RemFlag(LLObject.ObjectFlags flag)
|
||||||
{
|
{
|
||||||
LLObject.ObjectFlags prevflag = m_flags;
|
LLObject.ObjectFlags prevflag = Flags;
|
||||||
if ((ObjectFlags & (uint) flag) != 0)
|
if ((ObjectFlags & (uint) flag) != 0)
|
||||||
{
|
{
|
||||||
//Console.WriteLine("Removing flag: " + ((LLObject.ObjectFlags)flag).ToString());
|
//Console.WriteLine("Removing flag: " + ((LLObject.ObjectFlags)flag).ToString());
|
||||||
m_flags &= ~flag;
|
Flags &= ~flag;
|
||||||
}
|
}
|
||||||
//System.Console.WriteLine("prev: " + prevflag.ToString() + " curr: " + m_flags.ToString());
|
//System.Console.WriteLine("prev: " + prevflag.ToString() + " curr: " + Flags.ToString());
|
||||||
//ScheduleFullUpdate();
|
//ScheduleFullUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1581,10 +1523,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
if (remoteClient.AgentId == OwnerID)
|
if (remoteClient.AgentId == OwnerID)
|
||||||
{
|
{
|
||||||
if ((uint) (m_flags & LLObject.ObjectFlags.CreateSelected) != 0)
|
if ((uint) (Flags & LLObject.ObjectFlags.CreateSelected) != 0)
|
||||||
{
|
{
|
||||||
clientFlags |= (uint) LLObject.ObjectFlags.CreateSelected;
|
clientFlags |= (uint) LLObject.ObjectFlags.CreateSelected;
|
||||||
m_flags &= ~LLObject.ObjectFlags.CreateSelected;
|
Flags &= ~LLObject.ObjectFlags.CreateSelected;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue