Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor

avinationmerge
Kitto Flora 2011-01-13 04:48:32 +00:00
commit c0134710f7
5 changed files with 79 additions and 25 deletions

View File

@ -511,10 +511,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & objlist[0].RootPart.NextOwnerMask; item.EveryOnePermissions = objlist[0].RootPart.EveryoneMask & objlist[0].RootPart.NextOwnerMask;
item.GroupPermissions = objlist[0].RootPart.GroupMask & objlist[0].RootPart.NextOwnerMask; item.GroupPermissions = objlist[0].RootPart.GroupMask & objlist[0].RootPart.NextOwnerMask;
// Magic number badness. Maybe this deserves an enum. item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
// bit 4 (16) is the "Slam" bit, it means treat as passed
// and apply next owner perms on rez
item.CurrentPermissions |= 16; // Slam!
} }
else else
{ {
@ -789,13 +786,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{ {
rootPart.Name = item.Name; rootPart.Name = item.Name;
rootPart.Description = item.Description; rootPart.Description = item.Description;
}
if ((item.Flags & (uint)InventoryItemFlags.ObjectSlamSale) != 0)
{
rootPart.ObjectSaleType = item.SaleType; rootPart.ObjectSaleType = item.SaleType;
rootPart.SalePrice = item.SalePrice; rootPart.SalePrice = item.SalePrice;
} }
group.SetGroup(remoteClient.ActiveGroupId, remoteClient); group.SetGroup(remoteClient.ActiveGroupId, remoteClient);
// TODO: Remove the magic number badness
if ((rootPart.OwnerID != item.Owner) || if ((rootPart.OwnerID != item.Owner) ||
(item.CurrentPermissions & 16) != 0) (item.CurrentPermissions & 16) != 0 || // Magic number
(item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)
{ {
//Need to kill the for sale here //Need to kill the for sale here
rootPart.ObjectSaleType = 0; rootPart.ObjectSaleType = 0;
@ -807,10 +810,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
{ {
if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0) if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
{ {
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
part.EveryoneMask = item.EveryOnePermissions; part.EveryoneMask = item.EveryOnePermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
part.NextOwnerMask = item.NextPermissions; part.NextOwnerMask = item.NextPermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
part.GroupMask = item.GroupPermissions;
} }
part.GroupMask = 0; // DO NOT propagate here
} }
group.ApplyNextOwnerPermissions(); group.ApplyNextOwnerPermissions();
@ -819,16 +825,21 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
foreach (SceneObjectPart part in group.Parts) foreach (SceneObjectPart part in group.Parts)
{ {
// TODO: Remove the magic number badness
if ((part.OwnerID != item.Owner) || if ((part.OwnerID != item.Owner) ||
(item.CurrentPermissions & 16) != 0) (item.CurrentPermissions & 16) != 0 || // Magic number
(item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)
{ {
part.LastOwnerID = part.OwnerID; part.LastOwnerID = part.OwnerID;
part.OwnerID = item.Owner; part.OwnerID = item.Owner;
part.Inventory.ChangeInventoryOwner(item.Owner); part.Inventory.ChangeInventoryOwner(item.Owner);
part.GroupMask = 0; // DO NOT propagate here
} }
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
part.EveryoneMask = item.EveryOnePermissions; part.EveryoneMask = item.EveryOnePermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
part.NextOwnerMask = item.NextPermissions; part.NextOwnerMask = item.NextPermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
part.GroupMask = item.GroupPermissions;
} }
rootPart.TrimPermissions(); rootPart.TrimPermissions();

View File

@ -215,7 +215,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
part.NextOwnerMask; part.NextOwnerMask;
item.GroupPermissions = part.GroupMask & item.GroupPermissions = part.GroupMask &
part.NextOwnerMask; part.NextOwnerMask;
item.CurrentPermissions |= 16; // Slam! item.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
item.CreationDate = Util.UnixTimeSinceEpoch(); item.CreationDate = Util.UnixTimeSinceEpoch();
if (m_scene.AddInventoryItem(item)) if (m_scene.AddInventoryItem(item))

View File

@ -310,8 +310,14 @@ namespace OpenSim.Region.Framework.Scenes
{ {
item.Name = itemUpd.Name; item.Name = itemUpd.Name;
item.Description = itemUpd.Description; item.Description = itemUpd.Description;
if (item.NextPermissions != (itemUpd.NextPermissions & item.BasePermissions))
item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions; item.NextPermissions = itemUpd.NextPermissions & item.BasePermissions;
if (item.EveryOnePermissions != (itemUpd.EveryOnePermissions & item.BasePermissions))
item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone;
item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions; item.EveryOnePermissions = itemUpd.EveryOnePermissions & item.BasePermissions;
if (item.GroupPermissions != (itemUpd.GroupPermissions & item.BasePermissions))
item.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup;
item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions; item.GroupPermissions = itemUpd.GroupPermissions & item.BasePermissions;
item.GroupID = itemUpd.GroupID; item.GroupID = itemUpd.GroupID;
item.GroupOwned = itemUpd.GroupOwned; item.GroupOwned = itemUpd.GroupOwned;
@ -326,9 +332,12 @@ namespace OpenSim.Region.Framework.Scenes
// TODO: Check if folder changed and move item // TODO: Check if folder changed and move item
//item.NextPermissions = itemUpd.Folder; //item.NextPermissions = itemUpd.Folder;
item.InvType = itemUpd.InvType; item.InvType = itemUpd.InvType;
if (item.SalePrice != itemUpd.SalePrice ||
item.SaleType != itemUpd.SaleType)
item.Flags |= (uint)InventoryItemFlags.ObjectSlamSale;
item.SalePrice = itemUpd.SalePrice; item.SalePrice = itemUpd.SalePrice;
item.SaleType = itemUpd.SaleType; item.SaleType = itemUpd.SaleType;
item.Flags = itemUpd.Flags;
InventoryService.UpdateItem(item); InventoryService.UpdateItem(item);
} }
@ -509,7 +518,8 @@ namespace OpenSim.Region.Framework.Scenes
// Assign to the actual item. Make sure the slam bit is // Assign to the actual item. Make sure the slam bit is
// set, if it wasn't set before. // set, if it wasn't set before.
itemCopy.BasePermissions = basePerms; itemCopy.BasePermissions = basePerms;
itemCopy.CurrentPermissions = ownerPerms | 16; // Slam itemCopy.CurrentPermissions = ownerPerms;
itemCopy.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
itemCopy.NextPermissions = item.NextPermissions; itemCopy.NextPermissions = item.NextPermissions;
@ -1049,7 +1059,7 @@ namespace OpenSim.Region.Framework.Scenes
else else
agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions; agentItem.CurrentPermissions = agentItem.BasePermissions & taskItem.CurrentPermissions;
agentItem.CurrentPermissions |= 16; // Slam agentItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
agentItem.NextPermissions = taskItem.NextPermissions; agentItem.NextPermissions = taskItem.NextPermissions;
agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move); agentItem.EveryOnePermissions = taskItem.EveryonePermissions & (taskItem.NextPermissions | (uint)PermissionMask.Move);
agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions;
@ -1260,7 +1270,7 @@ namespace OpenSim.Region.Framework.Scenes
(srcTaskItem.NextPermissions | (uint)PermissionMask.Move); (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
destTaskItem.BasePermissions = srcTaskItem.BasePermissions & destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
(srcTaskItem.NextPermissions | (uint)PermissionMask.Move); (srcTaskItem.NextPermissions | (uint)PermissionMask.Move);
destTaskItem.CurrentPermissions |= 16; // Slam! destTaskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
} }
} }
@ -1434,6 +1444,8 @@ namespace OpenSim.Region.Framework.Scenes
// Base ALWAYS has move // Base ALWAYS has move
currentItem.BasePermissions |= (uint)PermissionMask.Move; currentItem.BasePermissions |= (uint)PermissionMask.Move;
itemInfo.Flags = currentItem.Flags;
// Check if we're allowed to mess with permissions // Check if we're allowed to mess with permissions
if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god if (!Permissions.IsGod(remoteClient.AgentId)) // Not a god
{ {
@ -1451,6 +1463,14 @@ namespace OpenSim.Region.Framework.Scenes
// Owner can't change base, and can change other // Owner can't change base, and can change other
// only up to base // only up to base
itemInfo.BasePermissions = currentItem.BasePermissions; itemInfo.BasePermissions = currentItem.BasePermissions;
if (itemInfo.EveryonePermissions != currentItem.EveryonePermissions)
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone;
if (itemInfo.GroupPermissions != currentItem.GroupPermissions)
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup;
if (itemInfo.CurrentPermissions != currentItem.CurrentPermissions)
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteOwner;
if (itemInfo.NextPermissions != currentItem.NextPermissions)
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
itemInfo.EveryonePermissions &= currentItem.BasePermissions; itemInfo.EveryonePermissions &= currentItem.BasePermissions;
itemInfo.GroupPermissions &= currentItem.BasePermissions; itemInfo.GroupPermissions &= currentItem.BasePermissions;
itemInfo.CurrentPermissions &= currentItem.BasePermissions; itemInfo.CurrentPermissions &= currentItem.BasePermissions;
@ -1458,6 +1478,19 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
else
{
if (itemInfo.BasePermissions != currentItem.BasePermissions)
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteBase;
if (itemInfo.EveryonePermissions != currentItem.EveryonePermissions)
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteEveryone;
if (itemInfo.GroupPermissions != currentItem.GroupPermissions)
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteGroup;
if (itemInfo.CurrentPermissions != currentItem.CurrentPermissions)
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteOwner;
if (itemInfo.NextPermissions != currentItem.NextPermissions)
itemInfo.Flags |= (uint)InventoryItemFlags.ObjectOverwriteNextOwner;
}
// Next ALWAYS has move // Next ALWAYS has move
itemInfo.NextPermissions |= (uint)PermissionMask.Move; itemInfo.NextPermissions |= (uint)PermissionMask.Move;
@ -1666,7 +1699,7 @@ namespace OpenSim.Region.Framework.Scenes
srcTaskItem.NextPermissions; srcTaskItem.NextPermissions;
destTaskItem.BasePermissions = srcTaskItem.BasePermissions & destTaskItem.BasePermissions = srcTaskItem.BasePermissions &
srcTaskItem.NextPermissions; srcTaskItem.NextPermissions;
destTaskItem.CurrentPermissions |= 16; // Slam! destTaskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
} }
} }

View File

@ -118,7 +118,7 @@ namespace OpenSim.Region.Framework.Scenes
taskItem.NextPermissions = item.NextPermissions; taskItem.NextPermissions = item.NextPermissions;
// We're adding this to a prim we don't own. Force // We're adding this to a prim we don't own. Force
// owner change // owner change
taskItem.CurrentPermissions |= 16; // Slam taskItem.Flags |= (uint)InventoryItemFlags.ObjectSlamPerm;
} }
else else
{ {

View File

@ -815,14 +815,19 @@ namespace OpenSim.Region.Framework.Scenes
group.SetGroup(m_part.GroupID, null); group.SetGroup(m_part.GroupID, null);
if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0) // TODO: Remove magic number badness
if ((rootPart.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number
{ {
if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions()) if (m_part.ParentGroup.Scene.Permissions.PropagatePermissions())
{ {
foreach (SceneObjectPart part in partList) foreach (SceneObjectPart part in partList)
{ {
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
part.EveryoneMask = item.EveryonePermissions; part.EveryoneMask = item.EveryonePermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
part.NextOwnerMask = item.NextPermissions; part.NextOwnerMask = item.NextPermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
part.GroupMask = item.GroupPermissions;
} }
group.ApplyNextOwnerPermissions(); group.ApplyNextOwnerPermissions();
@ -831,15 +836,20 @@ namespace OpenSim.Region.Framework.Scenes
foreach (SceneObjectPart part in partList) foreach (SceneObjectPart part in partList)
{ {
if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0) // TODO: Remove magic number badness
if ((part.OwnerID != item.OwnerID) || (item.CurrentPermissions & 16) != 0 || (item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0) // Magic number
{ {
part.LastOwnerID = part.OwnerID; part.LastOwnerID = part.OwnerID;
part.OwnerID = item.OwnerID; part.OwnerID = item.OwnerID;
part.Inventory.ChangeInventoryOwner(item.OwnerID); part.Inventory.ChangeInventoryOwner(item.OwnerID);
} }
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
part.EveryoneMask = item.EveryonePermissions; part.EveryoneMask = item.EveryonePermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
part.NextOwnerMask = item.NextPermissions; part.NextOwnerMask = item.NextPermissions;
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
part.GroupMask = item.GroupPermissions;
} }
rootPart.TrimPermissions(); rootPart.TrimPermissions();