Mantis5502 implementation of some of the new constants

Signed-off-by: Melanie <melanie@t-data.com>
This commit is contained in:
Talun
2012-04-09 19:58:07 +01:00
committed by Melanie
parent 0f277dfa17
commit 78c0028179
6 changed files with 155 additions and 20 deletions

View File

@@ -1081,10 +1081,59 @@ namespace OpenSim.Region.Framework.Scenes
}
}
}
return false;
}
/// <summary>
/// Returns the count of scripts in this parts inventory.
/// </summary>
/// <returns></returns>
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;
}
/// <summary>
/// Returns the count of running scripts in this parts inventory.
/// </summary>
/// <returns></returns>
public int RunningScriptCount()
{
IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
if (engines.Length == 0)
return 0;
int count = 0;
List<TaskInventoryItem> 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<UUID> GetInventoryList()
{
List<UUID> ret = new List<UUID>();