From a960273e91e43eedbab923539d817b81c0e50dbd Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 18 Oct 2012 23:02:57 +0100
Subject: Add number of inventory items to information displayed via "show
part" console command
---
.../World/Objects/Commands/ObjectCommandsModule.cs | 1 +
OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | 14 +++++++++++---
.../Region/Framework/Scenes/SceneObjectPartInventory.cs | 9 +++++++++
3 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
index 7a35182..5d0163a 100644
--- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
@@ -456,6 +456,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
sb.AppendFormat("Parent: {0}",
sop.IsRoot ? "Is Root\n" : string.Format("{0} {1}\n", sop.ParentGroup.Name, sop.ParentGroup.UUID));
sb.AppendFormat("Link number: {0}\n", sop.LinkNum);
+ sb.AppendFormat("Items: {0}\n", sop.Inventory.Count);
sb.AppendFormat("Flags: {0}\n", sop.Flags);
return sb;
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
index 8d62847..c457b2f 100644
--- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs
@@ -268,17 +268,25 @@ namespace OpenSim.Region.Framework.Interfaces
void ApplyGodPermissions(uint perms);
///
+ /// Number of items in this inventory.
+ ///
+ int Count { get; }
+
+ ///
/// Returns true if this inventory contains any scripts
///
bool ContainsScripts();
///
- /// Returns the count of scripts contained
- ///
+ /// Number of scripts in this inventory.
+ ///
+ ///
+ /// Includes both running and non running scripts.
+ ///
int ScriptCount();
///
- /// Returns the count of running scripts contained
+ /// Number of running scripts in this inventory.
///
int RunningScriptCount();
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 821fd81..bdb0446 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -92,6 +92,15 @@ namespace OpenSim.Region.Framework.Scenes
QueryScriptStates();
}
}
+
+ public int Count
+ {
+ get
+ {
+ lock (m_items)
+ return m_items.Count;
+ }
+ }
///
/// Constructor
--
cgit v1.1
From 1f3c9db2b9ba71a84438b53b2a8a6f398137deb0 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 18 Oct 2012 23:41:18 +0100
Subject: Add --full option to "show object name/uuid/pos" to show info on all
parts of an object, not just whole object summary information.
---
.../World/Objects/Commands/ObjectCommandsModule.cs | 80 ++++++++++++++++------
1 file changed, 60 insertions(+), 20 deletions(-)
diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
index 5d0163a..7ceac7e 100644
--- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
@@ -139,25 +139,29 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
"Objects",
false,
"show object uuid",
- "show object uuid ",
- "Show details of a scene object with the given UUID", HandleShowObjectByUuid);
+ "show object uuid [--full] ",
+ "Show details of a scene object with the given UUID",
+ "The --full option will print out information on all the parts of the object.",
+ HandleShowObjectByUuid);
m_console.Commands.AddCommand(
"Objects",
false,
"show object name",
- "show object name [--regex] ",
+ "show object name [--full] [--regex] ",
"Show details of scene objects with the given name.",
- "If --regex is specified then the name is treatead as a regular expression",
+ "The --full option will print out information on all the parts of the object.\n"
+ + "If --regex is specified then the name is treatead as a regular expression.",
HandleShowObjectByName);
m_console.Commands.AddCommand(
"Objects",
false,
"show object pos",
- "show object pos to ",
+ "show object pos [--full] to ",
"Show details of scene objects within the given area.",
- "Each component of the coord is comma separated. There must be no spaces between the commas.\n"
+ "The --full option will print out information on all the parts of the object.\n"
+ + "Each component of the coord is comma separated. There must be no spaces between the commas.\n"
+ "If you don't care about the z component you can simply omit it.\n"
+ "If you don't care about the x or y components then you can leave them blank (though a comma is still required)\n"
+ "If you want to specify the maxmimum value of a component then you can use ~ instead of a number\n"
@@ -216,7 +220,12 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
// m_log.DebugFormat("[OBJECTS COMMANDS MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
}
- private void OutputSogsToConsole(Predicate searchPredicate)
+ ///
+ /// Outputs the sogs to console.
+ ///
+ ///
+ /// If true then output all part details. If false then output summary.
+ private void OutputSogsToConsole(Predicate searchPredicate, bool showFull)
{
List sceneObjects = m_scene.GetSceneObjectGroups().FindAll(searchPredicate);
@@ -224,7 +233,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
foreach (SceneObjectGroup so in sceneObjects)
{
- AddSceneObjectReport(sb, so);
+ AddSceneObjectReport(sb, so, showFull);
sb.Append("\n");
}
@@ -253,21 +262,26 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
m_console.OutputFormat(sb.ToString());
}
- private void HandleShowObjectByUuid(string module, string[] cmd)
+ private void HandleShowObjectByUuid(string module, string[] cmdparams)
{
if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
return;
- if (cmd.Length < 4)
+ bool showFull = false;
+ OptionSet options = new OptionSet().Add("full", v => showFull = v != null );
+
+ List mainParams = options.Parse(cmdparams);
+
+ if (mainParams.Count < 4)
{
m_console.OutputFormat("Usage: show object uuid ");
return;
}
UUID objectUuid;
- if (!UUID.TryParse(cmd[3], out objectUuid))
+ if (!UUID.TryParse(mainParams[3], out objectUuid))
{
- m_console.OutputFormat("{0} is not a valid uuid", cmd[3]);
+ m_console.OutputFormat("{0} is not a valid uuid", mainParams[3]);
return;
}
@@ -280,7 +294,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
}
StringBuilder sb = new StringBuilder();
- AddSceneObjectReport(sb, so);
+ AddSceneObjectReport(sb, so, showFull);
m_console.OutputFormat(sb.ToString());
}
@@ -290,14 +304,17 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
return;
+ bool showFull = false;
bool useRegex = false;
- OptionSet options = new OptionSet().Add("regex", v=> useRegex = v != null );
+ OptionSet options = new OptionSet();
+ options.Add("full", v => showFull = v != null );
+ options.Add("regex", v => useRegex = v != null );
List mainParams = options.Parse(cmdparams);
if (mainParams.Count < 4)
{
- m_console.OutputFormat("Usage: show object name [--regex] ");
+ m_console.OutputFormat("Usage: show object name [--full] [--regex] ");
return;
}
@@ -315,7 +332,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
searchPredicate = so => so.Name == name;
}
- OutputSogsToConsole(searchPredicate);
+ OutputSogsToConsole(searchPredicate, showFull);
}
private void HandleShowObjectByPos(string module, string[] cmdparams)
@@ -323,9 +340,14 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
if (!(m_console.ConsoleScene == null || m_console.ConsoleScene == m_scene))
return;
- if (cmdparams.Length < 5)
+ bool showFull = false;
+ OptionSet options = new OptionSet().Add("full", v => showFull = v != null );
+
+ List mainParams = options.Parse(cmdparams);
+
+ if (mainParams.Count < 5)
{
- m_console.OutputFormat("Usage: show object pos to ");
+ m_console.OutputFormat("Usage: show object pos [--full] to ");
return;
}
@@ -337,7 +359,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
Predicate searchPredicate
= so => Util.IsInsideBox(so.AbsolutePosition, startVector, endVector);
- OutputSogsToConsole(searchPredicate);
+ OutputSogsToConsole(searchPredicate, showFull);
}
private void HandleShowPartByUuid(string module, string[] cmd)
@@ -437,7 +459,25 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
OutputSopsToConsole(searchPredicate);
}
- private StringBuilder AddSceneObjectReport(StringBuilder sb, SceneObjectGroup so)
+ private StringBuilder AddSceneObjectReport(StringBuilder sb, SceneObjectGroup so, bool showFull)
+ {
+ if (showFull)
+ {
+ foreach (SceneObjectPart sop in so.Parts)
+ {
+ AddScenePartReport(sb, sop);
+ sb.Append("\n");
+ }
+ }
+ else
+ {
+ AddSummarySceneObjectReport(sb, so);
+ }
+
+ return sb;
+ }
+
+ private StringBuilder AddSummarySceneObjectReport(StringBuilder sb, SceneObjectGroup so)
{
sb.AppendFormat("Name: {0}\n", so.Name);
sb.AppendFormat("Description: {0}\n", so.Description);
--
cgit v1.1
From 75f5e66d1c17ad6507a13c89345f3e4d351c44d2 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 18 Oct 2012 23:45:07 +0100
Subject: Add local and UUID to information output of "show object" and "show
part" region console commands
---
.../Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
index 7ceac7e..b90b71e 100644
--- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
@@ -481,6 +481,8 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
{
sb.AppendFormat("Name: {0}\n", so.Name);
sb.AppendFormat("Description: {0}\n", so.Description);
+ sb.AppendFormat("Local ID {0}\n", so.LocalId);
+ sb.AppendFormat("UUID {0}\n", so.UUID);
sb.AppendFormat("Location: {0} @ {1}\n", so.AbsolutePosition, so.Scene.RegionInfo.RegionName);
sb.AppendFormat("Parts: {0}\n", so.PrimCount);
sb.AppendFormat("Flags: {0}\n", so.RootPart.Flags);
@@ -492,6 +494,8 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
{
sb.AppendFormat("Name: {0}\n", sop.Name);
sb.AppendFormat("Description: {0}\n", sop.Description);
+ sb.AppendFormat("Local ID {0}\n", sop.LocalId);
+ sb.AppendFormat("UUID {0}\n", sop.UUID);
sb.AppendFormat("Location: {0} @ {1}\n", sop.AbsolutePosition, sop.ParentGroup.Scene.RegionInfo.RegionName);
sb.AppendFormat("Parent: {0}",
sop.IsRoot ? "Is Root\n" : string.Format("{0} {1}\n", sop.ParentGroup.Name, sop.ParentGroup.UUID));
--
cgit v1.1
From 845228b35e75dea4ec597ca394dd43196ff8bb48 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 18 Oct 2012 23:58:29 +0100
Subject: minor: Convert ad-hoc list building in ObjectCommandsModule to use
ConsoleDisplayList
---
.../World/Objects/Commands/ObjectCommandsModule.cs | 45 ++++++++++++----------
1 file changed, 24 insertions(+), 21 deletions(-)
diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
index b90b71e..6feba21 100644
--- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs
@@ -479,31 +479,34 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
private StringBuilder AddSummarySceneObjectReport(StringBuilder sb, SceneObjectGroup so)
{
- sb.AppendFormat("Name: {0}\n", so.Name);
- sb.AppendFormat("Description: {0}\n", so.Description);
- sb.AppendFormat("Local ID {0}\n", so.LocalId);
- sb.AppendFormat("UUID {0}\n", so.UUID);
- sb.AppendFormat("Location: {0} @ {1}\n", so.AbsolutePosition, so.Scene.RegionInfo.RegionName);
- sb.AppendFormat("Parts: {0}\n", so.PrimCount);
- sb.AppendFormat("Flags: {0}\n", so.RootPart.Flags);
-
- return sb;
+ ConsoleDisplayList cdl = new ConsoleDisplayList();
+ cdl.AddRow("Name", so.Name);
+ cdl.AddRow("Descrition", so.Description);
+ cdl.AddRow("Local ID", so.LocalId);
+ cdl.AddRow("UUID", so.UUID);
+ cdl.AddRow("Location", string.Format("{0} @ {1}", so.AbsolutePosition, so.Scene.Name));
+ cdl.AddRow("Parts", so.PrimCount);
+ cdl.AddRow("Flags", so.RootPart.Flags);
+
+ return sb.Append(cdl.ToString());
}
private StringBuilder AddScenePartReport(StringBuilder sb, SceneObjectPart sop)
{
- sb.AppendFormat("Name: {0}\n", sop.Name);
- sb.AppendFormat("Description: {0}\n", sop.Description);
- sb.AppendFormat("Local ID {0}\n", sop.LocalId);
- sb.AppendFormat("UUID {0}\n", sop.UUID);
- sb.AppendFormat("Location: {0} @ {1}\n", sop.AbsolutePosition, sop.ParentGroup.Scene.RegionInfo.RegionName);
- sb.AppendFormat("Parent: {0}",
- sop.IsRoot ? "Is Root\n" : string.Format("{0} {1}\n", sop.ParentGroup.Name, sop.ParentGroup.UUID));
- sb.AppendFormat("Link number: {0}\n", sop.LinkNum);
- sb.AppendFormat("Items: {0}\n", sop.Inventory.Count);
- sb.AppendFormat("Flags: {0}\n", sop.Flags);
-
- return sb;
+ ConsoleDisplayList cdl = new ConsoleDisplayList();
+ cdl.AddRow("Name", sop.Name);
+ cdl.AddRow("Description", sop.Description);
+ cdl.AddRow("Local ID", sop.LocalId);
+ cdl.AddRow("UUID", sop.UUID);
+ cdl.AddRow("Location", string.Format("{0} @ {1}", sop.AbsolutePosition, sop.ParentGroup.Scene.Name));
+ cdl.AddRow(
+ "Parent",
+ sop.IsRoot ? "Is Root" : string.Format("{0} {1}", sop.ParentGroup.Name, sop.ParentGroup.UUID));
+ cdl.AddRow("Link number", sop.LinkNum);
+ cdl.AddRow("Flags", sop.Flags);
+ cdl.AddRow("Items", sop.Inventory.Count);
+
+ return sb.Append(cdl.ToString());
}
private void HandleDeleteObject(string module, string[] cmd)
--
cgit v1.1