From 0f008d5f7d4a34d4f7529036f5dd83742423c42f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 6 Apr 2013 01:44:06 +0100 Subject: When rezzing a coalesced object, check adjust position of all components. --- .../InventoryAccess/InventoryAccessModule.cs | 47 +++++++++++++--------- 1 file changed, 27 insertions(+), 20 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index eaf4ce2..ebada5a 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -807,7 +807,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } } - if (item != null && !DoPreRezWhenFromItem(remoteClient, item, objlist, pos, attachment)) + if (item != null && !DoPreRezWhenFromItem(remoteClient, item, objlist, pos, veclist, attachment)) return null; for (int i = 0; i < objlist.Count; i++) @@ -905,10 +905,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess /// /// /// + /// + /// List of vector position adjustments for a coalesced objects. For ordinary objects + /// this list will contain just Vector3.Zero. The order of adjustments must match the order of objlist + /// /// /// true if we can processed with rezzing, false if we need to abort private bool DoPreRezWhenFromItem( - IClientAPI remoteClient, InventoryItemBase item, List objlist, Vector3 pos, bool isAttachment) + IClientAPI remoteClient, InventoryItemBase item, List objlist, + Vector3 pos, List veclist, bool isAttachment) { UUID fromUserInventoryItemId = UUID.Zero; @@ -932,27 +937,29 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } int primcount = 0; - foreach (SceneObjectGroup g in objlist) - primcount += g.PrimCount; - - if (!m_Scene.Permissions.CanRezObject( - primcount, remoteClient.AgentId, pos) - && !isAttachment) + for(int i = 0; i < objlist.Count; i++) { - // The client operates in no fail mode. It will - // have already removed the item from the folder - // if it's no copy. - // Put it back if it's not an attachment - // - if (((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) && (!isAttachment)) - remoteClient.SendBulkUpdateInventory(item); + SceneObjectGroup g = objlist[i]; + + if (!m_Scene.Permissions.CanRezObject( + g.PrimCount, remoteClient.AgentId, pos + veclist[i]) + && !isAttachment) + { + // The client operates in no fail mode. It will + // have already removed the item from the folder + // if it's no copy. + // Put it back if it's not an attachment + // + if (((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) && (!isAttachment)) + remoteClient.SendBulkUpdateInventory(item); - ILandObject land = m_Scene.LandChannel.GetLandObject(pos.X, pos.Y); - remoteClient.SendAlertMessage(string.Format( - "Can't rez object '{0}' at <{1:F3}, {2:F3}, {3:F3}> on parcel '{4}' in region {5}.", - item.Name, pos.X, pos.Y, pos.Z, land != null ? land.LandData.Name : "Unknown", m_Scene.RegionInfo.RegionName)); + ILandObject land = m_Scene.LandChannel.GetLandObject(pos.X, pos.Y); + remoteClient.SendAlertMessage(string.Format( + "Can't rez object '{0}' at <{1:F3}, {2:F3}, {3:F3}> on parcel '{4}' in region {5}.", + item.Name, pos.X, pos.Y, pos.Z, land != null ? land.LandData.Name : "Unknown", m_Scene.Name)); - return false; + return false; + } } for (int i = 0; i < objlist.Count; i++) -- cgit v1.1 From 7f070236f72058ba22d017048b978adea380f0a1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 6 Apr 2013 02:34:51 +0100 Subject: Fix taking (and rezzing) of coalesced objects in the non-root subregions of megaregions. This fixes the combined bounding box location for regions bigger than 256x256. It also fixes the position on taking coalesced objects in the non-root regions, where position checks are properly done on rez instead. It also fixes the megaregion land channel to return null if the land does not exist, which should probably also be done for the ordinary land channels rather than returning a dummy region. Inspiration from Garmin's commit in http://opensimulator.org/mantis/view.php?id=6595. Thanks! --- .../InventoryAccess/InventoryAccessModule.cs | 32 +++++++++++----------- .../World/Permissions/PermissionsModule.cs | 2 ++ 2 files changed, 18 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index ebada5a..f796ec9 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -357,19 +357,19 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess foreach (SceneObjectGroup objectGroup in objlist) { - Vector3 inventoryStoredPosition = new Vector3 - (((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize) - ? 250 - : objectGroup.AbsolutePosition.X) - , - (objectGroup.AbsolutePosition.Y > (int)Constants.RegionSize) - ? 250 - : objectGroup.AbsolutePosition.Y, - objectGroup.AbsolutePosition.Z); - - originalPositions[objectGroup.UUID] = objectGroup.AbsolutePosition; - - objectGroup.AbsolutePosition = inventoryStoredPosition; +// Vector3 inventoryStoredPosition = new Vector3 +// (((objectGroup.AbsolutePosition.X > (int)Constants.RegionSize) +// ? 250 +// : objectGroup.AbsolutePosition.X) +// , +// (objectGroup.AbsolutePosition.Y > (int)Constants.RegionSize) +// ? 250 +// : objectGroup.AbsolutePosition.Y, +// objectGroup.AbsolutePosition.Z); +// +// originalPositions[objectGroup.UUID] = objectGroup.AbsolutePosition; +// +// objectGroup.AbsolutePosition = inventoryStoredPosition; // Make sure all bits but the ones we want are clear // on take. @@ -397,9 +397,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess else itemXml = SceneObjectSerializer.ToOriginalXmlFormat(objlist[0], !asAttachment); - // Restore the position of each group now that it has been stored to inventory. - foreach (SceneObjectGroup objectGroup in objlist) - objectGroup.AbsolutePosition = originalPositions[objectGroup.UUID]; +// // Restore the position of each group now that it has been stored to inventory. +// foreach (SceneObjectGroup objectGroup in objlist) +// objectGroup.AbsolutePosition = originalPositions[objectGroup.UUID]; InventoryItemBase item = CreateItemForObject(action, remoteClient, objlist[0], folderID); diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 79dd4a0..77299be 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -1453,6 +1453,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions bool permission = false; + m_log.DebugFormat("[PERMISSIONS MODULE]: Checking rez object at {0} in {1}", objectPosition, m_scene.Name); + ILandObject land = m_scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); if (land == null) return false; -- cgit v1.1 From 06068444e2486cb761d266c6831c54fc27d7d5c2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 9 Apr 2013 23:21:13 +0100 Subject: Comment out rez perms logging I accidentally left in at 7f07023 (Sat Apr 6 02:34:51 2013) --- OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 77299be..f8e93e1 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -1453,7 +1453,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions bool permission = false; - m_log.DebugFormat("[PERMISSIONS MODULE]: Checking rez object at {0} in {1}", objectPosition, m_scene.Name); +// m_log.DebugFormat("[PERMISSIONS MODULE]: Checking rez object at {0} in {1}", objectPosition, m_scene.Name); ILandObject land = m_scene.LandChannel.GetLandObject(objectPosition.X, objectPosition.Y); if (land == null) return false; -- cgit v1.1 From 29e28f4b84677fa1e1b138d0ede610c55add12f2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 10 Apr 2013 00:05:03 +0100 Subject: minor: remove mono compiler warnings in InventoryAccessModule --- .../CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index f796ec9..e0009bb 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -353,7 +353,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess bool asAttachment) { CoalescedSceneObjects coa = new CoalescedSceneObjects(UUID.Zero); - Dictionary originalPositions = new Dictionary(); +// Dictionary originalPositions = new Dictionary(); foreach (SceneObjectGroup objectGroup in objlist) { @@ -936,8 +936,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } } - int primcount = 0; - for(int i = 0; i < objlist.Count; i++) + for (int i = 0; i < objlist.Count; i++) { SceneObjectGroup g = objlist[i]; -- cgit v1.1 From 148e46563f9f95e43a460780592deceed3dd5d14 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 10 Apr 2013 00:07:58 +0100 Subject: minor: fix mono compiler warning in ScriptsHttpRequests.cs --- OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs index ebf56cd..6793fc8 100644 --- a/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs +++ b/OpenSim/Region/CoreModules/Scripting/HttpRequest/ScriptsHttpRequests.cs @@ -395,7 +395,6 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest //public bool HttpVerboseThrottle = true; // not implemented public List HttpCustomHeaders = null; public bool HttpPragmaNoCache = true; - private Thread httpThread; // Request info private UUID _itemID; -- cgit v1.1