aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-12-11 20:58:11 +0000
committerJustin Clarke Casey2008-12-11 20:58:11 +0000
commit80e267dcfec335c5402922c4eb5587df9603f94d (patch)
tree0e81c20ec152e48dd52ed551a727d491d326bc95 /OpenSim/Framework/Communications/Cache/CachedUserInfo.cs
parentmake a couple of other config default to make the example ini to give us (diff)
downloadopensim-SC-80e267dcfec335c5402922c4eb5587df9603f94d.zip
opensim-SC-80e267dcfec335c5402922c4eb5587df9603f94d.tar.gz
opensim-SC-80e267dcfec335c5402922c4eb5587df9603f94d.tar.bz2
opensim-SC-80e267dcfec335c5402922c4eb5587df9603f94d.tar.xz
* refactor: Stop exposing InventoryFolderImpl.SubFolders publicly
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Communications/Cache/CachedUserInfo.cs45
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