diff options
author | Justin Clark-Casey (justincc) | 2010-01-29 18:11:53 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-01-29 18:11:53 +0000 |
commit | ae2174d8f526b225c3cccf551f1a9f01d6569203 (patch) | |
tree | c1c6ebd0ae5a51ad404b74e07019a459f42b1064 /OpenSim/Region/Framework | |
parent | Resolve one more conflict I overlooked (diff) | |
download | opensim-SC-ae2174d8f526b225c3cccf551f1a9f01d6569203.zip opensim-SC-ae2174d8f526b225c3cccf551f1a9f01d6569203.tar.gz opensim-SC-ae2174d8f526b225c3cccf551f1a9f01d6569203.tar.bz2 opensim-SC-ae2174d8f526b225c3cccf551f1a9f01d6569203.tar.xz |
Add method to get all items with the same name from a particular prim
Extend load oar test to check loading of a sound item
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | 13 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 26 |
2 files changed, 37 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index eeb5102..fa9bf19 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | |||
@@ -71,7 +71,8 @@ namespace OpenSim.Region.Framework.Interfaces | |||
71 | /// <summary> | 71 | /// <summary> |
72 | /// Start all the scripts contained in this entity's inventory | 72 | /// Start all the scripts contained in this entity's inventory |
73 | /// </summary> | 73 | /// </summary> |
74 | void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource); | 74 | void CreateScriptInstances(int startParam, bool postOnRez, string engine, int stateSource); |
75 | |||
75 | ArrayList GetScriptErrors(UUID itemID); | 76 | ArrayList GetScriptErrors(UUID itemID); |
76 | 77 | ||
77 | /// <summary> | 78 | /// <summary> |
@@ -143,6 +144,16 @@ namespace OpenSim.Region.Framework.Interfaces | |||
143 | TaskInventoryItem GetInventoryItem(UUID itemId); | 144 | TaskInventoryItem GetInventoryItem(UUID itemId); |
144 | 145 | ||
145 | /// <summary> | 146 | /// <summary> |
147 | /// Get inventory items by name. | ||
148 | /// </summary> | ||
149 | /// <param name="name"></param> | ||
150 | /// <returns> | ||
151 | /// A list of inventory items with that name. | ||
152 | /// If no inventory item has that name then an empty list is returned. | ||
153 | /// </returns> | ||
154 | IList<TaskInventoryItem> GetInventoryItems(string name); | ||
155 | |||
156 | /// <summary> | ||
146 | /// Update an existing inventory item. | 157 | /// Update an existing inventory item. |
147 | /// </summary> | 158 | /// </summary> |
148 | /// <param name="item">The updated item. An item with the same id must already exist | 159 | /// <param name="item">The updated item. An item with the same id must already exist |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 5f13278..b37e1a2 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -554,8 +554,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
554 | m_items.TryGetValue(itemId, out item); | 554 | m_items.TryGetValue(itemId, out item); |
555 | 555 | ||
556 | return item; | 556 | return item; |
557 | } | 557 | } |
558 | |||
559 | /// <summary> | ||
560 | /// Get inventory items by name. | ||
561 | /// </summary> | ||
562 | /// <param name="name"></param> | ||
563 | /// <returns> | ||
564 | /// A list of inventory items with that name. | ||
565 | /// If no inventory item has that name then an empty list is returned. | ||
566 | /// </returns> | ||
567 | public IList<TaskInventoryItem> GetInventoryItems(string name) | ||
568 | { | ||
569 | IList<TaskInventoryItem> items = new List<TaskInventoryItem>(); | ||
558 | 570 | ||
571 | lock (m_items) | ||
572 | { | ||
573 | foreach (TaskInventoryItem item in m_items.Values) | ||
574 | { | ||
575 | if (item.Name == name) | ||
576 | items.Add(item); | ||
577 | } | ||
578 | } | ||
579 | |||
580 | return items; | ||
581 | } | ||
582 | |||
559 | /// <summary> | 583 | /// <summary> |
560 | /// Update an existing inventory item. | 584 | /// Update an existing inventory item. |
561 | /// </summary> | 585 | /// </summary> |