* some refactoring on permissions
* temporary re-introduced the weird 'flip-back' behaviour, but debugging it; will remove it if I don't find anything.ThreadPoolClientBranch
parent
c7c567182a
commit
c927928245
|
@ -191,9 +191,6 @@ namespace OpenSim.Region.Environment
|
|||
}
|
||||
|
||||
SceneObjectGroup task = (SceneObjectGroup)m_scene.Entities[objID];
|
||||
LLUUID taskOwner = null;
|
||||
// Added this because at this point in time it wouldn't be wise for
|
||||
// the administrator object permissions to take effect.
|
||||
LLUUID objectOwner = task.OwnerID;
|
||||
|
||||
uint objflags = task.RootPart.ObjectFlags;
|
||||
|
@ -202,13 +199,14 @@ namespace OpenSim.Region.Environment
|
|||
// Remove any of the objectFlags that are temporary. These will get added back if appropriate
|
||||
// in the next bit of code
|
||||
|
||||
objflags &= ~(uint)LLObject.ObjectFlags.ObjectCopy; // Tells client you can copy the object
|
||||
objflags &= ~(uint)LLObject.ObjectFlags.ObjectModify; // tells client you can modify the object
|
||||
objflags &= ~(uint)LLObject.ObjectFlags.ObjectMove; // tells client that you can move the object (only, no mod)
|
||||
objflags &= ~(uint)LLObject.ObjectFlags.ObjectTransfer; // tells the client that you can /take/ the object if you don't own it
|
||||
objflags &= ~(uint)LLObject.ObjectFlags.ObjectYouOwner; // Tells client that you're the owner of the object
|
||||
objflags &= ~(uint)LLObject.ObjectFlags.ObjectYouOfficer; // Tells client that you've got group object editing permission. Used when ObjectGroupOwned is set
|
||||
|
||||
objflags &= (uint)
|
||||
~(LLObject.ObjectFlags.ObjectCopy | // Tells client you can copy the object
|
||||
LLObject.ObjectFlags.ObjectModify | // tells client you can modify the object
|
||||
LLObject.ObjectFlags.ObjectMove | // tells client that you can move the object (only, no mod)
|
||||
LLObject.ObjectFlags.ObjectTransfer | // tells the client that you can /take/ the object if you don't own it
|
||||
LLObject.ObjectFlags.ObjectYouOwner | // Tells client that you're the owner of the object
|
||||
LLObject.ObjectFlags.ObjectYouOfficer // Tells client that you've got group object editing permission. Used when ObjectGroupOwned is set
|
||||
);
|
||||
|
||||
// Creating the three ObjectFlags options for this method to choose from.
|
||||
// Customize the OwnerMask
|
||||
|
|
|
@ -199,7 +199,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
// Update item with new asset
|
||||
item.AssetID = asset.FullID;
|
||||
group.UpdateInventoryItem(item);
|
||||
group.GetProperites(remoteClient);
|
||||
group.GetProperties(remoteClient);
|
||||
|
||||
// Trigger rerunning of script (use TriggerRezScript event, see RezScript)
|
||||
if (isScriptRunning)
|
||||
|
@ -520,7 +520,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
if (group != null)
|
||||
{
|
||||
int type = group.RemoveInventoryItem(localID, itemID);
|
||||
group.GetProperites(remoteClient);
|
||||
group.GetProperties(remoteClient);
|
||||
if (type == 10)
|
||||
{
|
||||
EventManager.TriggerRemoveScript(localID, itemID);
|
||||
|
@ -599,7 +599,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
group.AddInventoryItem(remoteClient, localID, item, copyID);
|
||||
group.StartScript(localID, copyID);
|
||||
group.GetProperites(remoteClient);
|
||||
group.GetProperties(remoteClient);
|
||||
|
||||
// m_log.Info(
|
||||
// String.Format("[PRIMINVENTORY]: " +
|
||||
|
|
|
@ -106,7 +106,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
{
|
||||
if (((SceneObjectGroup) ent).LocalId == primLocalID)
|
||||
{
|
||||
((SceneObjectGroup) ent).GetProperites(remoteClient);
|
||||
((SceneObjectGroup) ent).GetProperties(remoteClient);
|
||||
((SceneObjectGroup) ent).IsSelected = true;
|
||||
LandManager.setPrimsTainted();
|
||||
break;
|
||||
|
|
|
@ -1078,7 +1078,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
///
|
||||
/// </summary>
|
||||
/// <param name="client"></param>
|
||||
public void GetProperites(IClientAPI client)
|
||||
public void GetProperties(IClientAPI client)
|
||||
{
|
||||
ObjectPropertiesPacket proper = (ObjectPropertiesPacket) PacketPool.Instance.GetPacket(PacketType.ObjectProperties);
|
||||
// TODO: don't create new blocks if recycling an old packet
|
||||
|
|
|
@ -1577,62 +1577,40 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
|
||||
public void UpdatePermissions(LLUUID AgentID, byte field, uint localID, uint mask, byte addRemTF)
|
||||
{
|
||||
bool set = addRemTF == 1;
|
||||
|
||||
// Are we the owner?
|
||||
if (AgentID == OwnerID)
|
||||
{
|
||||
m_log.Info("[PERMISSIONS]: field: " + field.ToString() + ", mask: " + mask.ToString() + " addRemTF: " +
|
||||
addRemTF.ToString());
|
||||
switch (field)
|
||||
{
|
||||
case 2:
|
||||
OwnerMask = ApplyMask(OwnerMask, set, mask);
|
||||
break;
|
||||
case 4:
|
||||
GroupMask = ApplyMask(GroupMask, set, mask);
|
||||
break;
|
||||
case 8:
|
||||
EveryoneMask = ApplyMask(EveryoneMask, set, mask);
|
||||
break;
|
||||
case 16:
|
||||
NextOwnerMask = ApplyMask(NextOwnerMask, set, mask);
|
||||
break;
|
||||
}
|
||||
|
||||
//Field 8 = EveryoneMask
|
||||
if (field == (byte) 8)
|
||||
ScheduleFullUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
private uint ApplyMask(uint val, bool set, uint mask)
|
||||
{
|
||||
m_log.Info("[PERMISSIONS]: Left over: " + (OwnerMask - EveryoneMask));
|
||||
if (addRemTF == (byte) 0)
|
||||
if (set)
|
||||
{
|
||||
//EveryoneMask = (uint)0;
|
||||
EveryoneMask &= ~mask;
|
||||
//EveryoneMask &= ~(uint)57344;
|
||||
return val |= mask;
|
||||
}
|
||||
else
|
||||
{
|
||||
//EveryoneMask = (uint)0;
|
||||
EveryoneMask |= mask;
|
||||
//EveryoneMask |= (uint)57344;
|
||||
}
|
||||
//ScheduleFullUpdate();
|
||||
SendFullUpdateToAllClientsExcept(AgentID);
|
||||
}
|
||||
//Field 16 = NextownerMask
|
||||
if (field == (byte) 16)
|
||||
{
|
||||
if (addRemTF == (byte) 0)
|
||||
{
|
||||
NextOwnerMask &= ~mask;
|
||||
}
|
||||
else
|
||||
{
|
||||
NextOwnerMask |= mask;
|
||||
}
|
||||
SendFullUpdateToAllClientsExcept(AgentID);
|
||||
}
|
||||
|
||||
if (field == (byte)2)
|
||||
{
|
||||
if (addRemTF == (byte)0)
|
||||
{
|
||||
//m_parentGroup.SetLocked(true);
|
||||
//PermissionMask.
|
||||
OwnerMask &= ~mask;
|
||||
}
|
||||
else
|
||||
{
|
||||
//m_parentGroup.SetLocked(false);
|
||||
OwnerMask |= mask;
|
||||
}
|
||||
SendFullUpdateToAllClients();
|
||||
|
||||
}
|
||||
|
||||
return val &= ~mask;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue