mantis 8246: don't allow 'delete object name' to delete attachments, but allow delete object id, with confirmation

0.9.0.1-postfixes
UbitUmarov 2017-10-06 02:40:28 +01:00
parent db88c93243
commit 8520ceed63
1 changed files with 12 additions and 9 deletions

View File

@ -803,12 +803,15 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
else else
so = m_scene.GetSceneObjectGroup(localId); so = m_scene.GetSceneObjectGroup(localId);
if (so!= null && !so.IsAttachment) if (so!= null)
deletes.Add(so); {
deletes.Add(so);
// if (deletes.Count == 0) if(so.IsAttachment)
// m_console.OutputFormat("No objects were found with uuid {0}", match); {
requireConfirmation = true;
m_console.OutputFormat("Warning: object with uuid {0} is a attachment", uuid);
}
}
break; break;
case "name": case "name":
@ -900,15 +903,15 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>(); List<SceneObjectGroup> sceneObjects = new List<SceneObjectGroup>();
Action<SceneObjectGroup> searchAction; Action<SceneObjectGroup> searchAction;
int refusedAttachments = 0;
if (useRegex) if (useRegex)
{ {
Regex nameRegex = new Regex(name); 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 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); m_scene.ForEachSOG(searchAction);