From abfede7819e470c4a9d135b529c40d19fb94dca5 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 6 Oct 2010 19:59:30 +0200 Subject: Plumb the path for multiple object deletes --- .../InventoryAccess/InventoryAccessModule.cs | 31 ++++++++++++--- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 44 +++++----------------- OpenSim/Region/Framework/Scenes/Scene.cs | 4 +- .../Region/Framework/Scenes/SceneObjectGroup.cs | 8 +++- .../Scenes/Tests/SceneObjectBasicTests.cs | 2 +- OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs | 2 +- 6 files changed, 45 insertions(+), 46 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index c1d6cd3..d05cfc2 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -196,13 +196,24 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess // currently calls this with multiple items. UUID ret = UUID.Zero; + Dictionary> deletes = + new Dictionary>(); + foreach (SceneObjectGroup g in objectGroups) - ret = DeleteToInventory(action, folderID, g, remoteClient); + { + if (!deletes.ContainsKey(g.OwnerID)) + deletes[g.OwnerID] = new List(); + + deletes[g.OwnerID].Add(g); + } + + foreach (List objlist in deletes.Values) + ret = DeleteToInventory(action, folderID, objlist, remoteClient); return ret; } - public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, + private UUID DeleteToInventory(DeRezAction action, UUID folderID, SceneObjectGroup objectGroup, IClientAPI remoteClient) { UUID assetID = UUID.Zero; @@ -315,10 +326,20 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } else { - // Catch all. Use lost & found - // + if (remoteClient == null || + objectGroup.OwnerID != remoteClient.AgentId) + { + // Taking copy of another person's item. Take to + // Objects folder. + folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.Object); + } + else + { + // Catch all. Use lost & found + // - folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); + folder = m_Scene.InventoryService.GetFolderForType(userID, AssetType.LostAndFoundFolder); + } } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 1bf6b87..4cc797b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -1689,37 +1689,6 @@ namespace OpenSim.Region.Framework.Scenes } } - /// - /// Called when one or more objects are removed from the environment into inventory. - /// - /// - /// - /// - /// - /// - public virtual void DeRezObject(IClientAPI remoteClient, List localIDs, - UUID groupID, DeRezAction action, UUID destinationID) - { - foreach (uint localID in localIDs) - { - DeRezObject(remoteClient, localID, groupID, action, destinationID); - } - } - - /// - /// Called when an object is removed from the environment into inventory. - /// - /// - /// - /// - /// - /// - public virtual void DeRezObject(IClientAPI remoteClient, uint localID, - UUID groupID, DeRezAction action, UUID destinationID) - { - DeRezObjects(remoteClient, new List() { localID }, groupID, action, destinationID); - } - public virtual void DeRezObjects(IClientAPI remoteClient, List localIDs, UUID groupID, DeRezAction action, UUID destinationID) { @@ -1990,14 +1959,19 @@ namespace OpenSim.Region.Framework.Scenes return group; } - public virtual bool returnObjects(SceneObjectGroup[] returnobjects, UUID AgentId) + public virtual bool returnObjects(SceneObjectGroup[] returnobjects, + UUID AgentId) { + List localIDs = new List(); + foreach (SceneObjectGroup grp in returnobjects) { - AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, "parcel owner return"); - DeRezObject(null, grp.RootPart.LocalId, - grp.RootPart.GroupID, DeRezAction.Return, UUID.Zero); + AddReturn(grp.OwnerID, grp.Name, grp.AbsolutePosition, + "parcel owner return"); + localIDs.Add(grp.RootPart.LocalId); } + DeRezObjects(null, localIDs, UUID.Zero, DeRezAction.Return, + UUID.Zero); return true; } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index fe0ab5b..0cfc235 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2735,7 +2735,7 @@ namespace OpenSim.Region.Framework.Scenes client.OnGrabUpdate += m_sceneGraph.MoveObject; client.OnSpinStart += m_sceneGraph.SpinStart; client.OnSpinUpdate += m_sceneGraph.SpinObject; - client.OnDeRezObject += DeRezObject; + client.OnDeRezObject += DeRezObjects; client.OnObjectName += m_sceneGraph.PrimName; client.OnObjectClickAction += m_sceneGraph.PrimClickAction; @@ -2864,7 +2864,7 @@ namespace OpenSim.Region.Framework.Scenes client.OnGrabUpdate -= m_sceneGraph.MoveObject; client.OnSpinStart -= m_sceneGraph.SpinStart; client.OnSpinUpdate -= m_sceneGraph.SpinObject; - client.OnDeRezObject -= DeRezObject; + client.OnDeRezObject -= DeRezObjects; client.OnObjectName -= m_sceneGraph.PrimName; client.OnObjectClickAction -= m_sceneGraph.PrimClickAction; client.OnObjectMaterial -= m_sceneGraph.PrimMaterial; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 5513584..f7a304f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1291,6 +1291,8 @@ namespace OpenSim.Region.Framework.Scenes ILandObject parcel = m_scene.LandChannel.GetLandObject( m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y); + List returns = new List(); + if (parcel != null && parcel.LandData != null && parcel.LandData.OtherCleanTime != 0) { @@ -1304,13 +1306,15 @@ namespace OpenSim.Region.Framework.Scenes DetachFromBackup(); m_log.InfoFormat("[SCENE]: Returning object {0} due to parcel auto return", RootPart.UUID.ToString()); m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel auto return"); - m_scene.DeRezObject(null, RootPart.LocalId, - RootPart.GroupID, DeRezAction.Return, UUID.Zero); + returns.Add(RootPart.LocalId); return; } } } + + m_scene.DeRezObjects(null, returns, UUID.Zero, + DeRezAction.Return, UUID.Zero); } if (HasGroupChanged) diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index 5616a4e..4969b09 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs @@ -142,7 +142,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene); IClientAPI client = SceneSetupHelpers.AddRootAgent(scene, agentId); - scene.DeRezObject(client, part.LocalId, UUID.Zero, DeRezAction.Delete, UUID.Zero); + scene.DeRezObjects(client, new System.Collections.Generic.List() { part.LocalId }, UUID.Zero, DeRezAction.Delete, UUID.Zero); SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); diff --git a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs index fc9db03..9d7733e 100644 --- a/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs +++ b/OpenSim/Tests/Common/Setup/SceneSetupHelpers.cs @@ -556,7 +556,7 @@ namespace OpenSim.Tests.Common.Setup AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; sogd.Enabled = false; - scene.DeRezObject(client, part.LocalId, UUID.Zero, action, destinationId); + scene.DeRezObjects(client, new List() { part.LocalId }, UUID.Zero, action, destinationId); sogd.InventoryDeQueueAndDelete(); } } -- cgit v1.1 From 9a5d0984a5d4d416cf2e8560648aa94de916ad20 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 7 Oct 2010 02:16:36 +0100 Subject: Fix autoreturn to not return zero objects --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index f7a304f..5f00f84 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1291,8 +1291,6 @@ namespace OpenSim.Region.Framework.Scenes ILandObject parcel = m_scene.LandChannel.GetLandObject( m_rootPart.GroupPosition.X, m_rootPart.GroupPosition.Y); - List returns = new List(); - if (parcel != null && parcel.LandData != null && parcel.LandData.OtherCleanTime != 0) { @@ -1306,15 +1304,13 @@ namespace OpenSim.Region.Framework.Scenes DetachFromBackup(); m_log.InfoFormat("[SCENE]: Returning object {0} due to parcel auto return", RootPart.UUID.ToString()); m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel auto return"); - returns.Add(RootPart.LocalId); + m_scene.DeRezObjects(null, new List() { RootPart.LocalId }, UUID.Zero, + DeRezAction.Return, UUID.Zero); return; } } } - - m_scene.DeRezObjects(null, returns, UUID.Zero, - DeRezAction.Return, UUID.Zero); } if (HasGroupChanged) -- cgit v1.1 From 9391c3ffee4fb722657ebb064f8ba02f1d1f8802 Mon Sep 17 00:00:00 2001 From: dahlia Date: Thu, 7 Oct 2010 19:34:46 -0700 Subject: add a flag in OpenSim.ini.example for enabling/disabling decoded sculpt map caching for meshing --- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 20a5bb4..c97db8c 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -81,7 +81,8 @@ namespace OpenSim.Region.Physics.Meshing { IConfig start_config = config.Configs["Startup"]; - decodedSculptMapPath = start_config.GetString("DecodedSculptMapPath","j2kDecodeCache"); + decodedSculptMapPath = start_config.GetString("DecodedSculptMapPath","j2kDecodeCache"); + cacheSculptMaps = start_config.GetBoolean("CacheSculptMaps", cacheSculptMaps); try { -- cgit v1.1 From 5dcbbb726a15bc14da76b59577d009c25ad5e4e1 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 8 Oct 2010 18:40:13 +0100 Subject: Change the order of actions to address a possible nullref --- OpenSim/Region/Framework/Scenes/SceneViewer.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/SceneViewer.cs b/OpenSim/Region/Framework/Scenes/SceneViewer.cs index b45291f..e6f7235 100644 --- a/OpenSim/Region/Framework/Scenes/SceneViewer.cs +++ b/OpenSim/Region/Framework/Scenes/SceneViewer.cs @@ -179,11 +179,10 @@ namespace OpenSim.Region.Framework.Scenes public void Reset() { - if (m_pendingObjects != null) + lock (m_pendingObjects) { - lock (m_pendingObjects) + if (m_pendingObjects != null) { - m_pendingObjects.Clear(); m_pendingObjects = null; } -- cgit v1.1 From 4a0911bdbd3429d88b448bd324d8813cf6023e64 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 8 Oct 2010 19:19:07 +0100 Subject: Guard against locking a nullref to avoid build break --- OpenSim/Region/Framework/Scenes/SceneViewer.cs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/SceneViewer.cs b/OpenSim/Region/Framework/Scenes/SceneViewer.cs index e6f7235..b44a010 100644 --- a/OpenSim/Region/Framework/Scenes/SceneViewer.cs +++ b/OpenSim/Region/Framework/Scenes/SceneViewer.cs @@ -179,6 +179,9 @@ namespace OpenSim.Region.Framework.Scenes public void Reset() { + if (m_pendingObjects == null) + return; + lock (m_pendingObjects) { if (m_pendingObjects != null) -- cgit v1.1 From 4a57288577dd3ec6a99f467b4a2761fe83b0b4b8 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 8 Oct 2010 23:23:07 +0100 Subject: Fix an infinite recursion --- .../CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index d05cfc2..7a175ea 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -208,7 +208,10 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess } foreach (List objlist in deletes.Values) - ret = DeleteToInventory(action, folderID, objlist, remoteClient); + { + foreach (SceneObjectGroup g in objlist) + ret = DeleteToInventory(action, folderID, g, remoteClient); + } return ret; } -- cgit v1.1 From 211ea5d52126bf19d53e57af750a0a964a60b56e Mon Sep 17 00:00:00 2001 From: Marck Date: Sun, 19 Sep 2010 13:26:06 +0200 Subject: Limit formatting of local console output to actual logging messages. The formatting of lines with the help of a regular expression match will be done only for output with an explicitly given logging level. This fixes the issue of colons being added to help texts on the local console. --- OpenSim/Framework/Console/LocalConsole.cs | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs index 6043094..5f2f404 100644 --- a/OpenSim/Framework/Console/LocalConsole.cs +++ b/OpenSim/Framework/Console/LocalConsole.cs @@ -44,6 +44,7 @@ namespace OpenSim.Framework.Console // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // private readonly object m_syncRoot = new object(); + private const string LOGLEVEL_NONE = "(none)"; private int y = -1; private int cp = 0; @@ -278,22 +279,25 @@ namespace OpenSim.Framework.Console private void WriteLocalText(string text, string level) { - string regex = @"^(?.*?)\[(?[^\]]+)\]:?(?.*)"; - - Regex RE = new Regex(regex, RegexOptions.Multiline); - MatchCollection matches = RE.Matches(text); - string outText = text; - if (matches.Count == 1) + if (level != LOGLEVEL_NONE) { - outText = matches[0].Groups["End"].Value; - System.Console.Write(matches[0].Groups["Front"].Value); + string regex = @"^(?.*?)\[(?[^\]]+)\]:?(?.*)"; + + Regex RE = new Regex(regex, RegexOptions.Multiline); + MatchCollection matches = RE.Matches(text); - System.Console.Write("["); - WriteColorText(DeriveColor(matches[0].Groups["Category"].Value), - matches[0].Groups["Category"].Value); - System.Console.Write("]:"); + if (matches.Count == 1) + { + outText = matches[0].Groups["End"].Value; + System.Console.Write(matches[0].Groups["Front"].Value); + + System.Console.Write("["); + WriteColorText(DeriveColor(matches[0].Groups["Category"].Value), + matches[0].Groups["Category"].Value); + System.Console.Write("]:"); + } } if (level == "error") @@ -308,7 +312,7 @@ namespace OpenSim.Framework.Console public override void Output(string text) { - Output(text, "normal"); + Output(text, LOGLEVEL_NONE); } public override void Output(string text, string level) -- cgit v1.1 From ed161020e2da611e56c63ea8314e5305845f3377 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 9 Oct 2010 01:46:29 +0100 Subject: minor: remove some mono compiler warnings --- OpenSim/Framework/Tests/MundaneFrameworkTests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs index 04be083..e7f8bfc 100644 --- a/OpenSim/Framework/Tests/MundaneFrameworkTests.cs +++ b/OpenSim/Framework/Tests/MundaneFrameworkTests.cs @@ -140,10 +140,10 @@ namespace OpenSim.Framework.Tests settings.Save(); settings.OnSave -= RegionSaveFired; - string str = settings.LoadedCreationDate; - int dt = settings.LoadedCreationDateTime; - string id = settings.LoadedCreationID; - string time = settings.LoadedCreationTime; +// string str = settings.LoadedCreationDate; +// int dt = settings.LoadedCreationDateTime; +// string id = settings.LoadedCreationID; +// string time = settings.LoadedCreationTime; Assert.That(m_RegionSettingsOnSaveEventFired, "RegionSettings Save Event didn't Fire"); -- cgit v1.1