From 8520ceed630cd0abea467559f613a50311723cb0 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 6 Oct 2017 02:40:28 +0100 Subject: mantis 8246: don't allow 'delete object name' to delete attachments, but allow delete object id, with confirmation --- .../World/Objects/Commands/ObjectCommandsModule.cs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/CoreModules/World') diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index 5a2a173..28f1869 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs @@ -803,12 +803,15 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands else so = m_scene.GetSceneObjectGroup(localId); - if (so!= null && !so.IsAttachment) - deletes.Add(so); - - // if (deletes.Count == 0) - // m_console.OutputFormat("No objects were found with uuid {0}", match); - + if (so!= null) + { + deletes.Add(so); + if(so.IsAttachment) + { + requireConfirmation = true; + m_console.OutputFormat("Warning: object with uuid {0} is a attachment", uuid); + } + } break; case "name": @@ -900,15 +903,15 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands List sceneObjects = new List(); Action searchAction; - + int refusedAttachments = 0; if (useRegex) { Regex nameRegex = new Regex(name); - searchAction = so => { if (nameRegex.IsMatch(so.Name)) { sceneObjects.Add(so); }}; + searchAction = so => { if (nameRegex.IsMatch(so.Name)) {if(!so.IsAttachment) sceneObjects.Add(so);}}; } else { - searchAction = so => { if (so.Name == name) { sceneObjects.Add(so); }}; + searchAction = so => { if (so.Name == name) {if(!so.IsAttachment) sceneObjects.Add(so);}}; } m_scene.ForEachSOG(searchAction); -- cgit v1.1