diff options
author | Melanie | 2012-04-09 21:40:03 +0100 |
---|---|---|
committer | Melanie | 2012-04-09 21:40:03 +0100 |
commit | 67d4f1d66cef2ff51453f113bdaef375004b17c9 (patch) | |
tree | 975abcb48e2492950ea974567379de88809f57f5 /OpenSim/Region/Framework | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Mantis5502 implementation of some of the new constants (diff) | |
download | opensim-SC-67d4f1d66cef2ff51453f113bdaef375004b17c9.zip opensim-SC-67d4f1d66cef2ff51453f113bdaef375004b17c9.tar.gz opensim-SC-67d4f1d66cef2ff51453f113bdaef375004b17c9.tar.bz2 opensim-SC-67d4f1d66cef2ff51453f113bdaef375004b17c9.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/Framework/Interfaces/IScriptModule.cs
OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
Diffstat (limited to 'OpenSim/Region/Framework')
6 files changed, 135 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index 32f4eea..4d70888 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | |||
@@ -228,6 +228,16 @@ namespace OpenSim.Region.Framework.Interfaces | |||
228 | bool ContainsScripts(); | 228 | bool ContainsScripts(); |
229 | 229 | ||
230 | /// <summary> | 230 | /// <summary> |
231 | /// Returns the count of scripts contained | ||
232 | /// </summary></returns> | ||
233 | int ScriptCount(); | ||
234 | |||
235 | /// <summary> | ||
236 | /// Returns the count of running scripts contained | ||
237 | /// </summary></returns> | ||
238 | int RunningScriptCount(); | ||
239 | |||
240 | /// <summary> | ||
231 | /// Get the uuids of all items in this inventory | 241 | /// Get the uuids of all items in this inventory |
232 | /// </summary> | 242 | /// </summary> |
233 | /// <returns></returns> | 243 | /// <returns></returns> |
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs index ce66100..4f8be10 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs | |||
@@ -71,6 +71,12 @@ namespace OpenSim.Region.Framework.Interfaces | |||
71 | 71 | ||
72 | bool HasScript(UUID itemID, out bool running); | 72 | bool HasScript(UUID itemID, out bool running); |
73 | 73 | ||
74 | /// <summary> | ||
75 | /// Returns true if a script is running. | ||
76 | /// </summary> | ||
77 | /// <param name="itemID">The item ID of the script.</param> | ||
78 | bool GetScriptState(UUID itemID); | ||
79 | |||
74 | void SaveAllState(); | 80 | void SaveAllState(); |
75 | 81 | ||
76 | /// <summary> | 82 | /// <summary> |
@@ -87,4 +93,4 @@ namespace OpenSim.Region.Framework.Interfaces | |||
87 | /// </returns> | 93 | /// </returns> |
88 | Dictionary<uint, float> GetObjectScriptsExecutionTimes(); | 94 | Dictionary<uint, float> GetObjectScriptsExecutionTimes(); |
89 | } | 95 | } |
90 | } \ No newline at end of file | 96 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index b806d91..77e808e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -156,7 +156,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
156 | // that the region position is cached or performance will degrade | 156 | // that the region position is cached or performance will degrade |
157 | Utils.LongToUInts(regionHandle, out x, out y); | 157 | Utils.LongToUInts(regionHandle, out x, out y); |
158 | GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); | 158 | GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); |
159 | // bool v = true; | 159 | if (dest == null) |
160 | continue; | ||
161 | |||
160 | if (!simulatorList.Contains(dest.ServerURI)) | 162 | if (!simulatorList.Contains(dest.ServerURI)) |
161 | { | 163 | { |
162 | // we havent seen this simulator before, add it to the list | 164 | // we havent seen this simulator before, add it to the list |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 107d9b6..5786f48 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -4017,7 +4017,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
4017 | for (int i = 0; i < parts.Length; i++) | 4017 | for (int i = 0; i < parts.Length; i++) |
4018 | parts[i].TriggerScriptChangedEvent(val); | 4018 | parts[i].TriggerScriptChangedEvent(val); |
4019 | } | 4019 | } |
4020 | 4020 | ||
4021 | /// <summary> | ||
4022 | /// Returns a count of the number of scripts in this groups parts. | ||
4023 | /// </summary> | ||
4024 | public int ScriptCount() | ||
4025 | { | ||
4026 | int count = 0; | ||
4027 | SceneObjectPart[] parts = m_parts.GetArray(); | ||
4028 | for (int i = 0; i < parts.Length; i++) | ||
4029 | count += parts[i].Inventory.ScriptCount(); | ||
4030 | |||
4031 | return count; | ||
4032 | } | ||
4033 | |||
4034 | /// <summary> | ||
4035 | /// Returns a count of the number of running scripts in this groups parts. | ||
4036 | /// </summary> | ||
4037 | public int RunningScriptCount() | ||
4038 | { | ||
4039 | int count = 0; | ||
4040 | SceneObjectPart[] parts = m_parts.GetArray(); | ||
4041 | for (int i = 0; i < parts.Length; i++) | ||
4042 | count += parts[i].Inventory.RunningScriptCount(); | ||
4043 | |||
4044 | return count; | ||
4045 | } | ||
4046 | |||
4021 | public override string ToString() | 4047 | public override string ToString() |
4022 | { | 4048 | { |
4023 | return String.Format("{0} {1} ({2})", Name, UUID, AbsolutePosition); | 4049 | return String.Format("{0} {1} ({2})", Name, UUID, AbsolutePosition); |
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>(); |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b51d41b..0cb1556 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3521,6 +3521,44 @@ namespace OpenSim.Region.Framework.Scenes | |||
3521 | return m_attachments.Count > 0; | 3521 | return m_attachments.Count > 0; |
3522 | } | 3522 | } |
3523 | 3523 | ||
3524 | /// <summary> | ||
3525 | /// Returns the total count of scripts in all parts inventories. | ||
3526 | /// </summary> | ||
3527 | public int ScriptCount() | ||
3528 | { | ||
3529 | int count = 0; | ||
3530 | lock (m_attachments) | ||
3531 | { | ||
3532 | foreach (SceneObjectGroup gobj in m_attachments) | ||
3533 | { | ||
3534 | if (gobj != null) | ||
3535 | { | ||
3536 | count += gobj.ScriptCount(); | ||
3537 | } | ||
3538 | } | ||
3539 | } | ||
3540 | return count; | ||
3541 | } | ||
3542 | |||
3543 | /// <summary> | ||
3544 | /// Returns the total count of running scripts in all parts. | ||
3545 | /// </summary> | ||
3546 | public int RunningScriptCount() | ||
3547 | { | ||
3548 | int count = 0; | ||
3549 | lock (m_attachments) | ||
3550 | { | ||
3551 | foreach (SceneObjectGroup gobj in m_attachments) | ||
3552 | { | ||
3553 | if (gobj != null) | ||
3554 | { | ||
3555 | count += gobj.RunningScriptCount(); | ||
3556 | } | ||
3557 | } | ||
3558 | } | ||
3559 | return count; | ||
3560 | } | ||
3561 | |||
3524 | public bool HasScriptedAttachments() | 3562 | public bool HasScriptedAttachments() |
3525 | { | 3563 | { |
3526 | lock (m_attachments) | 3564 | lock (m_attachments) |