From 2ca520c1eb85fff573236cff321ac3d123c5a826 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Thu, 18 Oct 2012 23:02:57 +0100 Subject: [PATCH] Add number of inventory items to information displayed via "show part" console command --- .../World/Objects/Commands/ObjectCommandsModule.cs | 1 + .../Framework/Interfaces/IEntityInventory.cs | 14 +++++++++++--- .../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 7a35182f4b..5d0163a680 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 8d6284739b..c457b2f2f5 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs @@ -267,18 +267,26 @@ 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 821fd81d1f..bdb044692b 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