diff options
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/CachedUserInfo.cs')
-rw-r--r-- | OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | 45 |
1 files changed, 20 insertions, 25 deletions
diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index d3e715f..d597aad 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | |||
@@ -161,29 +161,27 @@ namespace OpenSim.Framework.Communications.Cache | |||
161 | List<InventoryFolderImpl> resolvedFolders = new List<InventoryFolderImpl>(); // Folders we've resolved with this invocation | 161 | List<InventoryFolderImpl> resolvedFolders = new List<InventoryFolderImpl>(); // Folders we've resolved with this invocation |
162 | foreach (InventoryFolderImpl folder in receivedFolderDictionary[parentFolder.ID]) | 162 | foreach (InventoryFolderImpl folder in receivedFolderDictionary[parentFolder.ID]) |
163 | { | 163 | { |
164 | lock (parentFolder.SubFolders) | 164 | if (parentFolder.ContainsChildFolder(folder.ID)) |
165 | { | 165 | { |
166 | if (parentFolder.SubFolders.ContainsKey(folder.ID)) | 166 | m_log.WarnFormat( |
167 | "[INVENTORY CACHE]: Received folder {0} {1} from inventory service which has already been received", | ||
168 | folder.Name, folder.ID); | ||
169 | } | ||
170 | else | ||
171 | { | ||
172 | if (resolvedFolderDictionary.ContainsKey(folder.ID)) | ||
167 | { | 173 | { |
168 | m_log.WarnFormat( | 174 | m_log.WarnFormat( |
169 | "[INVENTORY CACHE]: Received folder {0} {1} from inventory service which has already been received", | 175 | "[INVENTORY CACHE]: Received folder {0} {1} from inventory service has already been received but with different parent", |
170 | folder.Name, folder.ID); | 176 | folder.Name, folder.ID); |
171 | } | 177 | } |
172 | else | 178 | else |
173 | { | 179 | { |
174 | if ( resolvedFolderDictionary.ContainsKey( folder.ID ) ) { | 180 | resolvedFolders.Add(folder); |
175 | m_log.WarnFormat( | 181 | resolvedFolderDictionary[folder.ID] = folder; |
176 | "[INVENTORY CACHE]: Received folder {0} {1} from inventory service has already been received but with different parent", | 182 | parentFolder.AddChildFolder(folder); |
177 | folder.Name, folder.ID); | 183 | } |
178 | } | 184 | } |
179 | else | ||
180 | { | ||
181 | resolvedFolders.Add(folder); | ||
182 | resolvedFolderDictionary[folder.ID] = folder; | ||
183 | parentFolder.SubFolders.Add(folder.ID, folder); | ||
184 | } | ||
185 | } | ||
186 | } // lock (parentFolder.SubFolders) | ||
187 | } // foreach (folder in pendingCategorizationFolders[parentFolder.ID]) | 185 | } // foreach (folder in pendingCategorizationFolders[parentFolder.ID]) |
188 | 186 | ||
189 | receivedFolderDictionary.Remove(parentFolder.ID); | 187 | receivedFolderDictionary.Remove(parentFolder.ID); |
@@ -738,20 +736,17 @@ namespace OpenSim.Framework.Communications.Cache | |||
738 | } | 736 | } |
739 | } | 737 | } |
740 | 738 | ||
739 | /// <summary> | ||
740 | /// Find an appropriate folder for the given asset type | ||
741 | /// </summary> | ||
742 | /// <param name="type"></param> | ||
743 | /// <returns>null if no appropriate folder exists</returns> | ||
741 | public InventoryFolderImpl FindFolderForType(int type) | 744 | public InventoryFolderImpl FindFolderForType(int type) |
742 | { | 745 | { |
743 | if (RootFolder == null) | 746 | if (RootFolder == null) |
744 | return null; | 747 | return null; |
745 | 748 | ||
746 | lock (RootFolder.SubFolders) | 749 | return RootFolder.FindFolderForType(type); |
747 | { | ||
748 | foreach (InventoryFolderImpl f in RootFolder.SubFolders.Values) | ||
749 | { | ||
750 | if (f.Type == type) | ||
751 | return f; | ||
752 | } | ||
753 | } | ||
754 | return null; | ||
755 | } | 750 | } |
756 | } | 751 | } |
757 | 752 | ||