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(-)
(limited to 'OpenSim')
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