diff options
author | Melanie | 2010-02-02 03:56:29 +0000 |
---|---|---|
committer | Melanie | 2010-02-02 03:56:29 +0000 |
commit | d5ed92cf3892c507a31da587deb394e8d5842ed6 (patch) | |
tree | 270646e8dbf76aec39b83cc77a551ecf9e43f011 /OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |
parent | Small fix for a spurious exception (diff) | |
parent | Revert "improve locking of m_items in SceneObjectPartInventory" (diff) | |
download | opensim-SC-d5ed92cf3892c507a31da587deb394e8d5842ed6.zip opensim-SC-d5ed92cf3892c507a31da587deb394e8d5842ed6.tar.gz opensim-SC-d5ed92cf3892c507a31da587deb394e8d5842ed6.tar.bz2 opensim-SC-d5ed92cf3892c507a31da587deb394e8d5842ed6.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index 9661775..3317dd3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -585,8 +585,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
585 | m_items.TryGetValue(itemId, out item); | 585 | m_items.TryGetValue(itemId, out item); |
586 | m_items.LockItemsForRead(false); | 586 | m_items.LockItemsForRead(false); |
587 | return item; | 587 | return item; |
588 | } | 588 | } |
589 | |||
590 | /// <summary> | ||
591 | /// Get inventory items by name. | ||
592 | /// </summary> | ||
593 | /// <param name="name"></param> | ||
594 | /// <returns> | ||
595 | /// A list of inventory items with that name. | ||
596 | /// If no inventory item has that name then an empty list is returned. | ||
597 | /// </returns> | ||
598 | public IList<TaskInventoryItem> GetInventoryItems(string name) | ||
599 | { | ||
600 | IList<TaskInventoryItem> items = new List<TaskInventoryItem>(); | ||
601 | |||
602 | lock (m_items) | ||
603 | { | ||
604 | foreach (TaskInventoryItem item in m_items.Values) | ||
605 | { | ||
606 | if (item.Name == name) | ||
607 | items.Add(item); | ||
608 | } | ||
609 | } | ||
589 | 610 | ||
611 | return items; | ||
612 | } | ||
613 | |||
590 | /// <summary> | 614 | /// <summary> |
591 | /// Update an existing inventory item. | 615 | /// Update an existing inventory item. |
592 | /// </summary> | 616 | /// </summary> |