diff options
author | Talun | 2012-04-09 19:58:07 +0100 |
---|---|---|
committer | Melanie | 2012-04-09 21:25:22 +0100 |
commit | 78c0028179923710949fea349baad2e6bebc49bd (patch) | |
tree | ad83b28069f46f0890cae3f9405f3d4c5f273da8 /OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |
parent | Addresses mantis #5846 (diff) | |
download | opensim-SC_OLD-78c0028179923710949fea349baad2e6bebc49bd.zip opensim-SC_OLD-78c0028179923710949fea349baad2e6bebc49bd.tar.gz opensim-SC_OLD-78c0028179923710949fea349baad2e6bebc49bd.tar.bz2 opensim-SC_OLD-78c0028179923710949fea349baad2e6bebc49bd.tar.xz |
Mantis5502 implementation of some of the new constants
Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 51 |
1 files changed, 50 insertions, 1 deletions
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 | |||
1081 | } | 1081 | } |
1082 | } | 1082 | } |
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | return false; | 1085 | return false; |
1086 | } | 1086 | } |
1087 | 1087 | ||
1088 | /// <summary> | ||
1089 | /// Returns the count of scripts in this parts inventory. | ||
1090 | /// </summary> | ||
1091 | /// <returns></returns> | ||
1092 | public int ScriptCount() | ||
1093 | { | ||
1094 | int count = 0; | ||
1095 | lock (m_items) | ||
1096 | { | ||
1097 | foreach (TaskInventoryItem item in m_items.Values) | ||
1098 | { | ||
1099 | if (item.InvType == (int)InventoryType.LSL) | ||
1100 | { | ||
1101 | count++; | ||
1102 | } | ||
1103 | } | ||
1104 | } | ||
1105 | |||
1106 | return count; | ||
1107 | } | ||
1108 | /// <summary> | ||
1109 | /// Returns the count of running scripts in this parts inventory. | ||
1110 | /// </summary> | ||
1111 | /// <returns></returns> | ||
1112 | public int RunningScriptCount() | ||
1113 | { | ||
1114 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); | ||
1115 | if (engines.Length == 0) | ||
1116 | return 0; | ||
1117 | |||
1118 | int count = 0; | ||
1119 | List<TaskInventoryItem> scripts = GetInventoryScripts(); | ||
1120 | |||
1121 | foreach (TaskInventoryItem item in scripts) | ||
1122 | { | ||
1123 | foreach (IScriptModule engine in engines) | ||
1124 | { | ||
1125 | if (engine != null) | ||
1126 | { | ||
1127 | if (engine.GetScriptState(item.ItemID)) | ||
1128 | { | ||
1129 | count++; | ||
1130 | } | ||
1131 | } | ||
1132 | } | ||
1133 | } | ||
1134 | return count; | ||
1135 | } | ||
1136 | |||
1088 | public List<UUID> GetInventoryList() | 1137 | public List<UUID> GetInventoryList() |
1089 | { | 1138 | { |
1090 | List<UUID> ret = new List<UUID>(); | 1139 | List<UUID> ret = new List<UUID>(); |