From 81aeecc90723658187668baa49bd168b7b333afb Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 24 Oct 2012 04:10:22 +0100
Subject: Allow "show object", "show part", "dump object" and "delete object"
to accept a local ID as well as a UUID.
This means that the sub-commands are now id rather than uuid, e.g. show object id
---
OpenSim/Region/Framework/Scenes/Scene.cs | 13 ++++++++++++-
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 24 ++++++++++++++++++++++++
2 files changed, 36 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 5f45529..532598a 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4688,13 +4688,24 @@ namespace OpenSim.Region.Framework.Scenes
/// Get a group via its UUID
///
///
- /// null if no group with that name exists
+ /// null if no group with that id exists
public SceneObjectGroup GetSceneObjectGroup(UUID fullID)
{
return m_sceneGraph.GetSceneObjectGroup(fullID);
}
///
+ /// Get a group via its local ID
+ ///
+ /// This will only return a group if the local ID matches a root part
+ ///
+ /// null if no group with that id exists
+ public SceneObjectGroup GetSceneObjectGroup(uint localID)
+ {
+ return m_sceneGraph.GetSceneObjectGroup(localID);
+ }
+
+ ///
/// Get a group by name from the scene (will return the first
/// found, if there are more than one prim with the same name)
///
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 209a770..a4383fd 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -983,6 +983,30 @@ namespace OpenSim.Region.Framework.Scenes
}
///
+ /// Get a group in the scene
+ ///
+ ///
+ /// This will only return a group if the local ID matches the root part, not other parts.
+ ///
+ /// Local id of the root part of the group
+ /// null if no such group was found
+ protected internal SceneObjectGroup GetSceneObjectGroup(uint localID)
+ {
+ lock (SceneObjectGroupsByLocalPartID)
+ {
+ if (SceneObjectGroupsByLocalPartID.ContainsKey(localID))
+ {
+ SceneObjectGroup so = SceneObjectGroupsByLocalPartID[localID];
+
+ if (so.LocalId == localID)
+ return so;
+ }
+ }
+
+ return null;
+ }
+
+ ///
/// Get a group by name from the scene (will return the first
/// found, if there are more than one prim with the same name)
///
--
cgit v1.1