Merge branch 'careminster' into careminster-presence-refactor

avinationmerge
Melanie 2010-05-21 03:03:35 +01:00
commit b6674c9b76
3 changed files with 54 additions and 23 deletions

View File

@ -397,29 +397,31 @@ namespace OpenSim.Region.Framework.Scenes
itemCopy.InvType = item.InvType; itemCopy.InvType = item.InvType;
itemCopy.Folder = recipientFolderId; itemCopy.Folder = recipientFolderId;
if (Permissions.PropagatePermissions()) if (Permissions.PropagatePermissions() && recipient != senderId)
{ {
// First, make sore base is limited to the next perms
itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
// By default, current equals base
itemCopy.CurrentPermissions = itemCopy.BasePermissions;
// If this is an object, replace current perms
// with folded perms
if (item.InvType == (int)InventoryType.Object) if (item.InvType == (int)InventoryType.Object)
{ {
itemCopy.BasePermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer); itemCopy.CurrentPermissions &= ~(uint)(PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer);
itemCopy.BasePermissions |= (item.CurrentPermissions & 7) << 13; itemCopy.CurrentPermissions |= (item.CurrentPermissions & 7) << 13;
}
else
{
itemCopy.BasePermissions = item.BasePermissions & item.NextPermissions;
} }
itemCopy.CurrentPermissions = itemCopy.BasePermissions; // Ensure there is no escalation
if ((item.CurrentPermissions & 8) != 0) // Propagate slam bit itemCopy.CurrentPermissions &= item.NextPermissions;
{
itemCopy.BasePermissions &= item.NextPermissions; // Need slam bit on xfer
itemCopy.CurrentPermissions = itemCopy.BasePermissions; itemCopy.CurrentPermissions |= 8;
itemCopy.CurrentPermissions |= 8;
}
itemCopy.NextPermissions = item.NextPermissions; itemCopy.NextPermissions = item.NextPermissions;
itemCopy.EveryOnePermissions = item.EveryOnePermissions & item.NextPermissions;
itemCopy.GroupPermissions = item.GroupPermissions & item.NextPermissions; itemCopy.EveryOnePermissions = 0;
itemCopy.GroupPermissions = 0;
} }
else else
{ {
@ -914,12 +916,12 @@ namespace OpenSim.Region.Framework.Scenes
if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions()) if ((part.OwnerID != destAgent) && Permissions.PropagatePermissions())
{ {
agentItem.BasePermissions = taskItem.BasePermissions & taskItem.NextPermissions;
if (taskItem.InvType == (int)InventoryType.Object) if (taskItem.InvType == (int)InventoryType.Object)
agentItem.BasePermissions = taskItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13); agentItem.CurrentPermissions = agentItem.BasePermissions & ((taskItem.CurrentPermissions & 7) << 13);
else agentItem.CurrentPermissions = agentItem.BasePermissions ;
agentItem.BasePermissions = taskItem.BasePermissions;
agentItem.BasePermissions &= taskItem.NextPermissions; agentItem.CurrentPermissions |= 8;
agentItem.CurrentPermissions = agentItem.BasePermissions | 8;
agentItem.NextPermissions = taskItem.NextPermissions; agentItem.NextPermissions = taskItem.NextPermissions;
agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions; agentItem.EveryOnePermissions = taskItem.EveryonePermissions & taskItem.NextPermissions;
agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions; agentItem.GroupPermissions = taskItem.GroupPermissions & taskItem.NextPermissions;

View File

@ -888,13 +888,43 @@ namespace OpenSim.Region.Framework.Scenes
if (land != null) if (land != null)
{ {
//Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni. //Don't restrict gods, estate managers, or land owners to the TP point. This behaviour mimics agni.
if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero && m_userLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid) && land.LandData.OwnerID != m_uuid) if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero && UserLevel < 200 && !m_scene.RegionInfo.EstateSettings.IsEstateManager(m_uuid) && land.LandData.OwnerID != m_uuid)
{ {
pos = land.LandData.UserLocation; pos = land.LandData.UserLocation;
} }
} }
} }
if (pos.X < 0 || pos.Y < 0 || pos.Z < 0)
{
Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128);
if (pos.X < 0)
{
emergencyPos.X = (int)Constants.RegionSize + pos.X;
if (!(pos.Y < 0))
emergencyPos.Y = pos.Y;
if (!(pos.Z < 0))
emergencyPos.Z = pos.Z;
}
if (pos.Y < 0)
{
emergencyPos.Y = (int)Constants.RegionSize + pos.Y;
if (!(pos.X < 0))
emergencyPos.X = pos.X;
if (!(pos.Z < 0))
emergencyPos.Z = pos.Z;
}
if (pos.Z < 0)
{
emergencyPos.Z = 128;
if (!(pos.Y < 0))
emergencyPos.Y = pos.Y;
if (!(pos.X < 0))
emergencyPos.X = pos.X;
}
}
if (pos.X < 0f || pos.Y < 0f || pos.Z < 0f) if (pos.X < 0f || pos.Y < 0f || pos.Z < 0f)
{ {
m_log.WarnFormat( m_log.WarnFormat(

View File

@ -1191,7 +1191,6 @@
; Service connector to Groups Service [Select One] ServicesConnectorModule ; Service connector to Groups Service [Select One] ServicesConnectorModule
; Simian Grid Service for Groups ; Simian Grid Service for Groups
;ServicesConnectorModule = SimianGroupsServicesConnector ;ServicesConnectorModule = SimianGroupsServicesConnector
;GroupsServerURI = http://mygridserver.com:82/Grid/ ;GroupsServerURI = http://mygridserver.com:82/Grid/