aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-05-04 17:16:01 +0000
committerJustin Clarke Casey2009-05-04 17:16:01 +0000
commitee5774208ff3f025eb1f61896d289f62c5a81726 (patch)
treede427b4afcae08fd03f3e3997bb5d672855cf5ca /OpenSim
parent* Insert profile references for creators for items saved into iars (diff)
downloadopensim-SC-ee5774208ff3f025eb1f61896d289f62c5a81726.zip
opensim-SC-ee5774208ff3f025eb1f61896d289f62c5a81726.tar.gz
opensim-SC-ee5774208ff3f025eb1f61896d289f62c5a81726.tar.bz2
opensim-SC-ee5774208ff3f025eb1f61896d289f62c5a81726.tar.xz
* Enhance some internal inventory data plugin behaviour to match what was probably intended
* (e.g returning combined results of plugin rather than always the first result) * This will not affect any existing functionality
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Communications/IInventoryServices.cs2
-rw-r--r--OpenSim/Framework/Communications/InventoryServiceBase.cs31
-rw-r--r--OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs2
3 files changed, 21 insertions, 14 deletions
diff --git a/OpenSim/Framework/Communications/IInventoryServices.cs b/OpenSim/Framework/Communications/IInventoryServices.cs
index e37b188..3f1e9ef 100644
--- a/OpenSim/Framework/Communications/IInventoryServices.cs
+++ b/OpenSim/Framework/Communications/IInventoryServices.cs
@@ -134,4 +134,4 @@ namespace OpenSim.Framework.Communications
134 /// <returns>null if no root folder was found</returns> 134 /// <returns>null if no root folder was found</returns>
135 InventoryFolderBase RequestRootFolder(UUID userID); 135 InventoryFolderBase RequestRootFolder(UUID userID);
136 } 136 }
137} 137} \ No newline at end of file
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs
index ff66250..0909a52 100644
--- a/OpenSim/Framework/Communications/InventoryServiceBase.cs
+++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs
@@ -117,11 +117,15 @@ namespace OpenSim.Framework.Communications
117 // See IInventoryServices 117 // See IInventoryServices
118 public virtual InventoryFolderBase RequestRootFolder(UUID userID) 118 public virtual InventoryFolderBase RequestRootFolder(UUID userID)
119 { 119 {
120 // FIXME: Probably doesn't do what was originally intended - only ever queries the first plugin 120 // Retrieve the first root folder we get from the list of plugins.
121 foreach (IInventoryDataPlugin plugin in m_plugins) 121 foreach (IInventoryDataPlugin plugin in m_plugins)
122 { 122 {
123 return plugin.getUserRootFolder(userID); 123 InventoryFolderBase rootFolder = plugin.getUserRootFolder(userID);
124 if (rootFolder != null)
125 return rootFolder;
124 } 126 }
127
128 // Return nothing if no plugin was able to supply a root folder
125 return null; 129 return null;
126 } 130 }
127 131
@@ -154,11 +158,13 @@ namespace OpenSim.Framework.Communications
154 158
155 public List<InventoryItemBase> GetActiveGestures(UUID userId) 159 public List<InventoryItemBase> GetActiveGestures(UUID userId)
156 { 160 {
161 List<InventoryItemBase> activeGestures = new List<InventoryItemBase>();
157 foreach (IInventoryDataPlugin plugin in m_plugins) 162 foreach (IInventoryDataPlugin plugin in m_plugins)
158 { 163 {
159 return plugin.fetchActiveGestures(userId); 164 activeGestures.AddRange(plugin.fetchActiveGestures(userId));
160 } 165 }
161 return new List<InventoryItemBase>(); 166
167 return activeGestures;
162 } 168 }
163 169
164 #endregion 170 #endregion
@@ -168,21 +174,24 @@ namespace OpenSim.Framework.Communications
168 public List<InventoryFolderBase> RequestSubFolders(UUID parentFolderID) 174 public List<InventoryFolderBase> RequestSubFolders(UUID parentFolderID)
169 { 175 {
170 List<InventoryFolderBase> inventoryList = new List<InventoryFolderBase>(); 176 List<InventoryFolderBase> inventoryList = new List<InventoryFolderBase>();
177
171 foreach (IInventoryDataPlugin plugin in m_plugins) 178 foreach (IInventoryDataPlugin plugin in m_plugins)
172 { 179 {
173 return plugin.getInventoryFolders(parentFolderID); 180 inventoryList.AddRange(plugin.getInventoryFolders(parentFolderID));
174 } 181 }
182
175 return inventoryList; 183 return inventoryList;
176 } 184 }
177 185
178 public List<InventoryItemBase> RequestFolderItems(UUID folderID) 186 public List<InventoryItemBase> RequestFolderItems(UUID folderID)
179 { 187 {
180 List<InventoryItemBase> itemsList = new List<InventoryItemBase>(); 188 List<InventoryItemBase> itemsList = new List<InventoryItemBase>();
189
181 foreach (IInventoryDataPlugin plugin in m_plugins) 190 foreach (IInventoryDataPlugin plugin in m_plugins)
182 { 191 {
183 itemsList = plugin.getInventoryInFolder(folderID); 192 itemsList.AddRange(plugin.getInventoryInFolder(folderID));
184 return itemsList;
185 } 193 }
194
186 return itemsList; 195 return itemsList;
187 } 196 }
188 197
@@ -284,9 +293,7 @@ namespace OpenSim.Framework.Communications
284 { 293 {
285 InventoryItemBase result = plugin.queryInventoryItem(item.ID); 294 InventoryItemBase result = plugin.queryInventoryItem(item.ID);
286 if (result != null) 295 if (result != null)
287 {
288 return result; 296 return result;
289 }
290 } 297 }
291 298
292 return null; 299 return null;
@@ -298,9 +305,7 @@ namespace OpenSim.Framework.Communications
298 { 305 {
299 InventoryFolderBase result = plugin.queryInventoryFolder(item.ID); 306 InventoryFolderBase result = plugin.queryInventoryFolder(item.ID);
300 if (result != null) 307 if (result != null)
301 {
302 return result; 308 return result;
303 }
304 } 309 }
305 310
306 return null; 311 return null;
@@ -353,7 +358,9 @@ namespace OpenSim.Framework.Communications
353 { 358 {
354 foreach (IInventoryDataPlugin plugin in m_plugins) 359 foreach (IInventoryDataPlugin plugin in m_plugins)
355 { 360 {
356 return plugin.getInventoryItem(itemID); 361 InventoryItemBase item = plugin.getInventoryItem(itemID);
362 if (item != null)
363 return item;
357 } 364 }
358 365
359 return null; 366 return null;
diff --git a/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs b/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs
index 7478cdd..ba14790 100644
--- a/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs
+++ b/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Framework.Communications
72 72
73 public virtual void AddTemporaryUserProfile(UserProfileData userProfile) 73 public virtual void AddTemporaryUserProfile(UserProfileData userProfile)
74 { 74 {
75 m_log.DebugFormat("[TEMP USER PROFILE]: Adding {0} {1}", userProfile.Name, userProfile.ID); 75 //m_log.DebugFormat("[TEMP USER PROFILE]: Adding {0} {1}", userProfile.Name, userProfile.ID);
76 76
77 lock (m_profiles) 77 lock (m_profiles)
78 { 78 {