mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
add cap AttachmentResources ( no urls, memory account is per yengine mem usage)
This commit is contained in:
@@ -5228,6 +5228,42 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return time;
|
||||
}
|
||||
|
||||
public int ScriptsMemory()
|
||||
{
|
||||
IScriptModule[] engines = Scene.RequestModuleInterfaces<IScriptModule>();
|
||||
|
||||
if (engines.Length == 0) // No engine at all
|
||||
return 0;
|
||||
|
||||
int memory = 0;
|
||||
|
||||
// get all the scripts in all parts
|
||||
SceneObjectPart[] parts = m_parts.GetArray();
|
||||
List<TaskInventoryItem> scripts = new List<TaskInventoryItem>();
|
||||
for (int i = 0; i < parts.Length; i++)
|
||||
{
|
||||
scripts.AddRange(parts[i].Inventory.GetInventoryItems(InventoryType.LSL));
|
||||
}
|
||||
// extract the UUIDs
|
||||
List<UUID> ids = new List<UUID>(scripts.Count);
|
||||
foreach (TaskInventoryItem script in scripts)
|
||||
{
|
||||
if (!ids.Contains(script.ItemID))
|
||||
{
|
||||
ids.Add(script.ItemID);
|
||||
}
|
||||
}
|
||||
// Offer the list of script UUIDs to each engine found and accumulate the memory
|
||||
foreach (IScriptModule e in engines)
|
||||
{
|
||||
if (e != null)
|
||||
{
|
||||
memory += e.GetScriptsMemory(ids);
|
||||
}
|
||||
}
|
||||
return memory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a count of the number of running scripts in this groups parts.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user