diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index a2649ee..7e629c0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -1280,9 +1280,59 @@ namespace OpenSim.Region.Framework.Scenes | |||
1280 | return true; | 1280 | return true; |
1281 | } | 1281 | } |
1282 | } | 1282 | } |
1283 | |||
1283 | return false; | 1284 | return false; |
1284 | } | 1285 | } |
1285 | 1286 | ||
1287 | /// <summary> | ||
1288 | /// Returns the count of scripts in this parts inventory. | ||
1289 | /// </summary> | ||
1290 | /// <returns></returns> | ||
1291 | public int ScriptCount() | ||
1292 | { | ||
1293 | int count = 0; | ||
1294 | lock (m_items) | ||
1295 | { | ||
1296 | foreach (TaskInventoryItem item in m_items.Values) | ||
1297 | { | ||
1298 | if (item.InvType == (int)InventoryType.LSL) | ||
1299 | { | ||
1300 | count++; | ||
1301 | } | ||
1302 | } | ||
1303 | } | ||
1304 | |||
1305 | return count; | ||
1306 | } | ||
1307 | /// <summary> | ||
1308 | /// Returns the count of running scripts in this parts inventory. | ||
1309 | /// </summary> | ||
1310 | /// <returns></returns> | ||
1311 | public int RunningScriptCount() | ||
1312 | { | ||
1313 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); | ||
1314 | if (engines.Length == 0) | ||
1315 | return 0; | ||
1316 | |||
1317 | int count = 0; | ||
1318 | List<TaskInventoryItem> scripts = GetInventoryScripts(); | ||
1319 | |||
1320 | foreach (TaskInventoryItem item in scripts) | ||
1321 | { | ||
1322 | foreach (IScriptModule engine in engines) | ||
1323 | { | ||
1324 | if (engine != null) | ||
1325 | { | ||
1326 | if (engine.GetScriptState(item.ItemID)) | ||
1327 | { | ||
1328 | count++; | ||
1329 | } | ||
1330 | } | ||
1331 | } | ||
1332 | } | ||
1333 | return count; | ||
1334 | } | ||
1335 | |||
1286 | public List<UUID> GetInventoryList() | 1336 | public List<UUID> GetInventoryList() |
1287 | { | 1337 | { |
1288 | List<UUID> ret = new List<UUID>(); | 1338 | List<UUID> ret = new List<UUID>(); |