From 7e32313a491defe8f5fb62ce0036c1692d4b4af9 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 3 Jan 2014 07:41:06 -0800 Subject: varregion: Add region size to teleport event messages (EnableSimulator, CorssRegion, TeleportFinishEvent). Have Simian grid service return the region size. Many teleport related debug log messages. Can be removed when teleport works (like that's ever going to happen). Conflicts: OpenSim/Framework/RegionInfo.cs --- .../EntityTransfer/EntityTransferModule.cs | 32 ++++++++++++++-------- 1 file changed, 21 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/CoreModules/Framework') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index ef5239a..717c802 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -825,7 +825,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // The EnableSimulator message makes the client establish a connection with the destination // simulator by sending the initial UseCircuitCode UDP packet to the destination containing the // correct circuit code. - m_eqModule.EnableSimulator(destinationHandle, endPoint, sp.UUID); + m_eqModule.EnableSimulator(destinationHandle, endPoint, sp.UUID, + finalDestination.RegionSizeX, finalDestination.RegionSizeY); + m_log.DebugFormat("{0} Sent EnableSimulator. regName={1}, size=<{2},{3}>", LogHeader, + finalDestination.RegionName, finalDestination.RegionSizeX, finalDestination.RegionSizeY); // XXX: Is this wait necessary? We will always end up waiting on UpdateAgent for the destination // simulator to confirm that it has established communication with the viewer. @@ -835,7 +838,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // unnecessary - teleport will succeed and SEED caps will be requested without it (though possibly // only on TeleportFinish). This is untested for region teleport between different simulators // though this probably also works. - m_eqModule.EstablishAgentCommunication(sp.UUID, endPoint, capsPath); + m_eqModule.EstablishAgentCommunication(sp.UUID, endPoint, capsPath, finalDestination.RegionHandle, + finalDestination.RegionSizeX, finalDestination.RegionSizeY); } else { @@ -921,7 +925,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // OK, send TPFinish to the client, so that it starts the process of contacting the destination region if (m_eqModule != null) { - m_eqModule.TeleportFinishEvent(destinationHandle, 13, endPoint, 0, teleportFlags, capsPath, sp.UUID); + m_eqModule.TeleportFinishEvent(destinationHandle, 13, endPoint, 0, teleportFlags, capsPath, sp.UUID, + finalDestination.RegionSizeX, finalDestination.RegionSizeY); } else { @@ -1074,7 +1079,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // New protocol: send TP Finish directly, without prior ES or EAC. That's what happens in the Linden grid if (m_eqModule != null) - m_eqModule.TeleportFinishEvent(destinationHandle, 13, endPoint, 0, teleportFlags, capsPath, sp.UUID); + m_eqModule.TeleportFinishEvent(destinationHandle, 13, endPoint, 0, teleportFlags, capsPath, sp.UUID, + finalDestination.RegionSizeX, finalDestination.RegionSizeY); else sp.ControllingClient.SendRegionTeleport(destinationHandle, 13, endPoint, 4, teleportFlags, capsPath); @@ -1717,11 +1723,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer if (m_eqModule != null) { m_eqModule.CrossRegion( - neighbourRegion.RegionHandle, pos + agent.Velocity, vel2 /* agent.Velocity */, neighbourRegion.ExternalEndPoint, - capsPath, agent.UUID, agent.ControllingClient.SessionId); + neighbourRegion.RegionHandle, pos + agent.Velocity, vel2 /* agent.Velocity */, + neighbourRegion.ExternalEndPoint, + capsPath, agent.UUID, agent.ControllingClient.SessionId, + neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY); } else { + m_log.ErrorFormat("{0} Using old CrossRegion packet. Varregion will not work!!", LogHeader); agent.ControllingClient.CrossRegion(neighbourRegion.RegionHandle, pos + agent.Velocity, agent.Velocity, neighbourRegion.ExternalEndPoint, capsPath); } @@ -2087,12 +2096,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } #endregion - m_log.DebugFormat("[ENTITY TRANSFER MODULE]: {0} is sending {1} EnableSimulator for neighbour region {2} @ {3} " + - "and EstablishAgentCommunication with seed cap {4}", - scene.RegionInfo.RegionName, sp.Name, reg.RegionName, reg.RegionHandle, capsPath); + m_log.DebugFormat("{0} {1} is sending {2} EnableSimulator for neighbour region {3}(loc=<{4},{5}>,siz=<{6},{7}>) " + + "and EstablishAgentCommunication with seed cap {8}", LogHeader, + scene.RegionInfo.RegionName, sp.Name, + reg.RegionName, reg.RegionLocX, reg.RegionLocY, reg.RegionSizeX, reg.RegionSizeY , capsPath); - m_eqModule.EnableSimulator(reg.RegionHandle, endPoint, sp.UUID); - m_eqModule.EstablishAgentCommunication(sp.UUID, endPoint, capsPath); + m_eqModule.EnableSimulator(reg.RegionHandle, endPoint, sp.UUID, reg.RegionSizeX, reg.RegionSizeY); + m_eqModule.EstablishAgentCommunication(sp.UUID, endPoint, capsPath, reg.RegionHandle, reg.RegionSizeX, reg.RegionSizeY); } else { -- cgit v1.1 From 38148bd4b68ad718bf6274342ac8382a611e2010 Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Sat, 4 Jan 2014 17:52:38 -0800 Subject: Some missing definitions needed for successful compilation. --- .../CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules/Framework') diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 717c802..246b253 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -51,7 +51,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "EntityTransferModule")] public class EntityTransferModule : INonSharedRegionModule, IEntityTransferModule { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly string LogHeader = "[ENTITY TRANSFER MODULE]"; public const int DefaultMaxTransferDistance = 4095; public const bool WaitForAgentArrivedAtDestinationDefault = true; -- cgit v1.1 From 13f31fdf85c404896c166932730b7b8bc5416626 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 4 Nov 2013 19:28:24 +0200 Subject: Refactored setting permissions when rezzing items: use the same function when rezzing from user inventory and prim inventory. Also, fixed a bug: when rezzing a coalesced object from a prim's inventory, apply the coalesced object's name and description only to the first sub-object; not to all the objects in the coalescence. (This was already done correctly when rezzing from a user's inventory.) --- .../InventoryAccess/InventoryAccessModule.cs | 51 ++++++---------------- 1 file changed, 14 insertions(+), 37 deletions(-) (limited to 'OpenSim/Region/CoreModules/Framework') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 831922e..da36ed0 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -512,10 +512,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess item.EveryOnePermissions = so.RootPart.EveryoneMask & so.RootPart.NextOwnerMask; item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask; - // Magic number badness. Maybe this deserves an enum. - // bit 4 (16) is the "Slam" bit, it means treat as passed - // and apply next owner perms on rez - item.CurrentPermissions |= 16; // Slam! + // apply next owner perms on rez + item.CurrentPermissions |= SceneObjectGroup.SLAM; } else { @@ -809,11 +807,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess group.RootPart.Shape.LastAttachPoint = (byte)group.AttachmentPoint; } - foreach (SceneObjectPart part in group.Parts) + if (item == null) { - // Make the rezzer the owner, as this is not necessarily set correctly in the serialized asset. - part.LastOwnerID = part.OwnerID; - part.OwnerID = remoteClient.AgentId; + // Change ownership. Normally this is done in DoPreRezWhenFromItem(), but in this case we must do it here. + foreach (SceneObjectPart part in group.Parts) + { + // Make the rezzer the owner, as this is not necessarily set correctly in the serialized asset. + part.LastOwnerID = part.OwnerID; + part.OwnerID = remoteClient.AgentId; + } } if (!attachment) @@ -969,44 +971,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // "[INVENTORY ACCESS MODULE]: rootPart.OwnedID {0}, item.Owner {1}, item.CurrentPermissions {2:X}", // rootPart.OwnerID, item.Owner, item.CurrentPermissions); - if ((rootPart.OwnerID != item.Owner) || - (item.CurrentPermissions & 16) != 0) + if ((rootPart.OwnerID != item.Owner) || (item.CurrentPermissions & SceneObjectGroup.SLAM) != 0) { //Need to kill the for sale here rootPart.ObjectSaleType = 0; rootPart.SalePrice = 10; - - if (m_Scene.Permissions.PropagatePermissions()) - { - foreach (SceneObjectPart part in so.Parts) - { - if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0) - { - part.EveryoneMask = item.EveryOnePermissions; - part.NextOwnerMask = item.NextPermissions; - } - part.GroupMask = 0; // DO NOT propagate here - } - - so.ApplyNextOwnerPermissions(); - } } - + foreach (SceneObjectPart part in so.Parts) { part.FromUserInventoryItemID = fromUserInventoryItemId; - - if ((part.OwnerID != item.Owner) || - (item.CurrentPermissions & 16) != 0) - { - part.Inventory.ChangeInventoryOwner(item.Owner); - part.GroupMask = 0; // DO NOT propagate here - } - - part.EveryoneMask = item.EveryOnePermissions; - part.NextOwnerMask = item.NextPermissions; + part.ApplyPermissionsOnRez(item, true, m_Scene); } - + rootPart.TrimPermissions(); if (isAttachment) -- cgit v1.1 From 91fd9c467083a57e2898594ce3ae764aa0525bb5 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Tue, 5 Nov 2013 15:42:23 +0200 Subject: Refactored: use a single function to apply an object's folded permissions to its main permissions --- .../InventoryAccess/InventoryAccessModule.cs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/CoreModules/Framework') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index da36ed0..a7e6fdd 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -443,13 +443,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } else { - AddPermissions(item, objlist[0], objlist, remoteClient); - item.CreationDate = Util.UnixTimeSinceEpoch(); item.Description = asset.Description; item.Name = asset.Name; item.AssetType = asset.Type; + AddPermissions(item, objlist[0], objlist, remoteClient); + m_Scene.AddInventoryItem(item); if (remoteClient != null && item.Owner == remoteClient.AgentId) @@ -495,16 +495,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess effectivePerms &= grp.GetEffectivePermissions(); effectivePerms |= (uint)PermissionMask.Move; + //PermissionsUtil.LogPermissions(item.Name, "Before AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions); + if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions()) { uint perms = effectivePerms; - uint nextPerms = (perms & 7) << 13; - if ((nextPerms & (uint)PermissionMask.Copy) == 0) - perms &= ~(uint)PermissionMask.Copy; - if ((nextPerms & (uint)PermissionMask.Transfer) == 0) - perms &= ~(uint)PermissionMask.Transfer; - if ((nextPerms & (uint)PermissionMask.Modify) == 0) - perms &= ~(uint)PermissionMask.Modify; + PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref perms); item.BasePermissions = perms & so.RootPart.NextOwnerMask; item.CurrentPermissions = item.BasePermissions; @@ -530,8 +526,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess (uint)PermissionMask.Move | (uint)PermissionMask.Export | 7); // Preserve folded permissions - } - + } + + //PermissionsUtil.LogPermissions(item.Name, "After AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions); + return item; } -- cgit v1.1 From a94e1e0e085a3c70e35e2c9cf0583d193c6ed32f Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Wed, 6 Nov 2013 12:57:44 +0200 Subject: When creating a coalesced object, set its Creator ID if all the objects have the same creator --- .../InventoryAccess/InventoryAccessModule.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/CoreModules/Framework') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index a7e6fdd..af95577 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -412,17 +412,28 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess if (item == null) return null; + + item.CreatorId = objlist[0].RootPart.CreatorID.ToString(); + item.CreatorData = objlist[0].RootPart.CreatorData; - // Can't know creator is the same, so null it in inventory if (objlist.Count > 1) { - item.CreatorId = UUID.Zero.ToString(); item.Flags = (uint)InventoryItemFlags.ObjectHasMultipleItems; + + // If the objects have different creators then don't specify a creator at all + foreach (SceneObjectGroup objectGroup in objlist) + { + if ((objectGroup.RootPart.CreatorID.ToString() != item.CreatorId) + || (objectGroup.RootPart.CreatorData.ToString() != item.CreatorData)) + { + item.CreatorId = UUID.Zero.ToString(); + item.CreatorData = string.Empty; + break; + } + } } else { - item.CreatorId = objlist[0].RootPart.CreatorID.ToString(); - item.CreatorData = objlist[0].RootPart.CreatorData; item.SaleType = objlist[0].RootPart.ObjectSaleType; item.SalePrice = objlist[0].RootPart.SalePrice; } -- cgit v1.1 From 88f01a41305364e0d505964c6743d95d1564530b Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Thu, 7 Nov 2013 17:25:39 +0200 Subject: When creating a coalesced object, set its permissions to the lowest-common-denominator of all the sub-objects --- .../InventoryAccess/InventoryAccessModule.cs | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/CoreModules/Framework') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index af95577..781cc69 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -502,8 +502,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess IClientAPI remoteClient) { uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move | PermissionMask.Export) | 7; + uint allObjectsNextOwnerPerms = 0x7fffffff; + uint allObjectsEveryOnePerms = 0x7fffffff; + uint allObjectsGroupPerms = 0x7fffffff; + foreach (SceneObjectGroup grp in objsForEffectivePermissions) + { effectivePerms &= grp.GetEffectivePermissions(); + allObjectsNextOwnerPerms &= grp.RootPart.NextOwnerMask; + allObjectsEveryOnePerms &= grp.RootPart.EveryoneMask; + allObjectsGroupPerms &= grp.RootPart.GroupMask; + } effectivePerms |= (uint)PermissionMask.Move; //PermissionsUtil.LogPermissions(item.Name, "Before AddPermissions", item.BasePermissions, item.CurrentPermissions, item.NextPermissions); @@ -513,11 +522,11 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess uint perms = effectivePerms; PermissionsUtil.ApplyFoldedPermissions(effectivePerms, ref perms); - item.BasePermissions = perms & so.RootPart.NextOwnerMask; + item.BasePermissions = perms & allObjectsNextOwnerPerms; item.CurrentPermissions = item.BasePermissions; - item.NextPermissions = perms & so.RootPart.NextOwnerMask; - item.EveryOnePermissions = so.RootPart.EveryoneMask & so.RootPart.NextOwnerMask; - item.GroupPermissions = so.RootPart.GroupMask & so.RootPart.NextOwnerMask; + item.NextPermissions = perms & allObjectsNextOwnerPerms; + item.EveryOnePermissions = allObjectsEveryOnePerms & allObjectsNextOwnerPerms; + item.GroupPermissions = allObjectsGroupPerms & allObjectsNextOwnerPerms; // apply next owner perms on rez item.CurrentPermissions |= SceneObjectGroup.SLAM; @@ -526,9 +535,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess { item.BasePermissions = effectivePerms; item.CurrentPermissions = effectivePerms; - item.NextPermissions = so.RootPart.NextOwnerMask & effectivePerms; - item.EveryOnePermissions = so.RootPart.EveryoneMask & effectivePerms; - item.GroupPermissions = so.RootPart.GroupMask & effectivePerms; + item.NextPermissions = allObjectsNextOwnerPerms & effectivePerms; + item.EveryOnePermissions = allObjectsEveryOnePerms & effectivePerms; + item.GroupPermissions = allObjectsGroupPerms & effectivePerms; item.CurrentPermissions &= ((uint)PermissionMask.Copy | -- cgit v1.1