From 78c0028179923710949fea349baad2e6bebc49bd Mon Sep 17 00:00:00 2001 From: Talun Date: Mon, 9 Apr 2012 19:58:07 +0100 Subject: Mantis5502 implementation of some of the new constants Signed-off-by: Melanie --- .../Framework/Scenes/SceneObjectPartInventory.cs | 51 +++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index f7e123b..9a04c65 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -1081,10 +1081,59 @@ namespace OpenSim.Region.Framework.Scenes } } } - + return false; } + /// + /// Returns the count of scripts in this parts inventory. + /// + /// + public int ScriptCount() + { + int count = 0; + lock (m_items) + { + foreach (TaskInventoryItem item in m_items.Values) + { + if (item.InvType == (int)InventoryType.LSL) + { + count++; + } + } + } + + return count; + } + /// + /// Returns the count of running scripts in this parts inventory. + /// + /// + public int RunningScriptCount() + { + IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces(); + if (engines.Length == 0) + return 0; + + int count = 0; + List scripts = GetInventoryScripts(); + + foreach (TaskInventoryItem item in scripts) + { + foreach (IScriptModule engine in engines) + { + if (engine != null) + { + if (engine.GetScriptState(item.ItemID)) + { + count++; + } + } + } + } + return count; + } + public List GetInventoryList() { List ret = new List(); -- cgit v1.1