diff options
author | Justin Clarke Casey | 2008-05-01 20:47:33 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-05-01 20:47:33 +0000 |
commit | 1de6cffa28348975a2492ce1e8a85c365df4dfaf (patch) | |
tree | 6431e5598defd603a4b2a8c5020b65d7df5a56a7 /OpenSim/Framework/Communications/InventoryServiceBase.cs | |
parent | create pass through of UserManagerBase to plugin calls (diff) | |
download | opensim-SC-1de6cffa28348975a2492ce1e8a85c365df4dfaf.zip opensim-SC-1de6cffa28348975a2492ce1e8a85c365df4dfaf.tar.gz opensim-SC-1de6cffa28348975a2492ce1e8a85c365df4dfaf.tar.bz2 opensim-SC-1de6cffa28348975a2492ce1e8a85c365df4dfaf.tar.xz |
* Refactor: Remove the unused userID parameter that was being passed into almost every inventory method
* This allows lots of redundant inventory methods with only slightly different names to be eliminated.
Diffstat (limited to 'OpenSim/Framework/Communications/InventoryServiceBase.cs')
-rw-r--r-- | OpenSim/Framework/Communications/InventoryServiceBase.cs | 79 |
1 files changed, 42 insertions, 37 deletions
diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index dab6a16..1601963 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs | |||
@@ -106,16 +106,6 @@ namespace OpenSim.Framework.Communications | |||
106 | 106 | ||
107 | return userFolders; | 107 | return userFolders; |
108 | } | 108 | } |
109 | |||
110 | // See IInventoryServices | ||
111 | public void MoveInventoryFolder(LLUUID userID, InventoryFolderBase folder) | ||
112 | { | ||
113 | // FIXME: Probably doesn't do what was originally intended - only ever queries the first plugin | ||
114 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | ||
115 | { | ||
116 | plugin.Value.moveInventoryFolder(folder); | ||
117 | } | ||
118 | } | ||
119 | 109 | ||
120 | // See IInventoryServices | 110 | // See IInventoryServices |
121 | public virtual bool HasInventoryForUser(LLUUID userID) | 111 | public virtual bool HasInventoryForUser(LLUUID userID) |
@@ -159,25 +149,7 @@ namespace OpenSim.Framework.Communications | |||
159 | } | 149 | } |
160 | 150 | ||
161 | // See IInventoryServices | 151 | // See IInventoryServices |
162 | public abstract void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback); | 152 | public abstract void RequestInventoryForUser(LLUUID userID, InventoryReceiptCallback callback); |
163 | |||
164 | // See IInventoryServices | ||
165 | public abstract void AddNewInventoryFolder(LLUUID userID, InventoryFolderBase folder); | ||
166 | |||
167 | // See IInventoryServices | ||
168 | public abstract void MoveExistingInventoryFolder(InventoryFolderBase folder); | ||
169 | |||
170 | // See IInventoryServices | ||
171 | public abstract void PurgeInventoryFolder(LLUUID userID, InventoryFolderBase folder); | ||
172 | |||
173 | // See IInventoryServices | ||
174 | public abstract void AddNewInventoryItem(LLUUID userID, InventoryItemBase item); | ||
175 | |||
176 | // See IInventoryServices | ||
177 | public abstract void UpdateInventoryItem(LLUUID userID, InventoryItemBase item); | ||
178 | |||
179 | // See IInventoryServices | ||
180 | public abstract void DeleteInventoryItem(LLUUID userID, InventoryItemBase item); | ||
181 | 153 | ||
182 | #endregion | 154 | #endregion |
183 | 155 | ||
@@ -206,47 +178,74 @@ namespace OpenSim.Framework.Communications | |||
206 | 178 | ||
207 | #endregion | 179 | #endregion |
208 | 180 | ||
209 | protected void AddFolder(InventoryFolderBase folder) | 181 | public bool AddFolder(InventoryFolderBase folder) |
210 | { | 182 | { |
211 | m_log.DebugFormat( | 183 | m_log.DebugFormat( |
212 | "[INVENTORY SERVICE BASE]: Adding folder {0}, {1} to {2}", folder.Name, folder.ID, folder.ParentID); | 184 | "[AGENT INVENTORY]: Adding folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); |
213 | 185 | ||
214 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | 186 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) |
215 | { | 187 | { |
216 | plugin.Value.addInventoryFolder(folder); | 188 | plugin.Value.addInventoryFolder(folder); |
217 | } | 189 | } |
190 | |||
191 | // FIXME: Should return false on failure | ||
192 | return true; | ||
218 | } | 193 | } |
219 | 194 | ||
220 | protected void MoveFolder(InventoryFolderBase folder) | 195 | public bool MoveFolder(InventoryFolderBase folder) |
221 | { | 196 | { |
197 | m_log.DebugFormat( | ||
198 | "[AGENT INVENTORY]: Moving folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); | ||
199 | |||
222 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | 200 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) |
223 | { | 201 | { |
224 | plugin.Value.moveInventoryFolder(folder); | 202 | plugin.Value.moveInventoryFolder(folder); |
225 | } | 203 | } |
204 | |||
205 | // FIXME: Should return false on failure | ||
206 | return true; | ||
226 | } | 207 | } |
227 | 208 | ||
228 | protected void AddItem(InventoryItemBase item) | 209 | public bool AddItem(InventoryItemBase item) |
229 | { | 210 | { |
211 | m_log.DebugFormat( | ||
212 | "[AGENT INVENTORY]: Adding item {0} {1} to folder {2}", item.Name, item.ID, item.Folder); | ||
213 | |||
230 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | 214 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) |
231 | { | 215 | { |
232 | plugin.Value.addInventoryItem(item); | 216 | plugin.Value.addInventoryItem(item); |
233 | } | 217 | } |
218 | |||
219 | // FIXME: Should return false on failure | ||
220 | return true; | ||
234 | } | 221 | } |
235 | 222 | ||
236 | protected void UpdateItem(InventoryItemBase item) | 223 | public bool UpdateItem(InventoryItemBase item) |
237 | { | 224 | { |
225 | m_log.InfoFormat( | ||
226 | "[AGENT INVENTORY]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder); | ||
227 | |||
238 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | 228 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) |
239 | { | 229 | { |
240 | plugin.Value.updateInventoryItem(item); | 230 | plugin.Value.updateInventoryItem(item); |
241 | } | 231 | } |
232 | |||
233 | // FIXME: Should return false on failure | ||
234 | return true; | ||
242 | } | 235 | } |
243 | 236 | ||
244 | protected void DeleteItem(InventoryItemBase item) | 237 | public bool DeleteItem(InventoryItemBase item) |
245 | { | 238 | { |
239 | m_log.InfoFormat( | ||
240 | "[AGENT INVENTORY]: Deleting item {0} {1} from folder {2}", item.Name, item.ID, item.Folder); | ||
241 | |||
246 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | 242 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) |
247 | { | 243 | { |
248 | plugin.Value.deleteInventoryItem(item.ID); | 244 | plugin.Value.deleteInventoryItem(item.ID); |
249 | } | 245 | } |
246 | |||
247 | // FIXME: Should return false on failure | ||
248 | return true; | ||
250 | } | 249 | } |
251 | 250 | ||
252 | /// <summary> | 251 | /// <summary> |
@@ -256,8 +255,11 @@ namespace OpenSim.Framework.Communications | |||
256 | /// already know... Needs heavy refactoring. | 255 | /// already know... Needs heavy refactoring. |
257 | /// </summary> | 256 | /// </summary> |
258 | /// <param name="folder"></param> | 257 | /// <param name="folder"></param> |
259 | protected void PurgeFolder(InventoryFolderBase folder) | 258 | public bool PurgeFolder(InventoryFolderBase folder) |
260 | { | 259 | { |
260 | m_log.DebugFormat( | ||
261 | "[AGENT INVENTORY]: Purging folder {0} {1} of its contents", folder.Name, folder.ID); | ||
262 | |||
261 | List<InventoryFolderBase> subFolders = RequestSubFolders(folder.ID); | 263 | List<InventoryFolderBase> subFolders = RequestSubFolders(folder.ID); |
262 | 264 | ||
263 | foreach (InventoryFolderBase subFolder in subFolders) | 265 | foreach (InventoryFolderBase subFolder in subFolders) |
@@ -276,6 +278,9 @@ namespace OpenSim.Framework.Communications | |||
276 | { | 278 | { |
277 | DeleteItem(item); | 279 | DeleteItem(item); |
278 | } | 280 | } |
281 | |||
282 | // FIXME: Should return false on failure | ||
283 | return true; | ||
279 | } | 284 | } |
280 | 285 | ||
281 | private void AddNewInventorySet(UsersInventory inventory) | 286 | private void AddNewInventorySet(UsersInventory inventory) |
@@ -283,7 +288,7 @@ namespace OpenSim.Framework.Communications | |||
283 | foreach (InventoryFolderBase folder in inventory.Folders.Values) | 288 | foreach (InventoryFolderBase folder in inventory.Folders.Values) |
284 | { | 289 | { |
285 | AddFolder(folder); | 290 | AddFolder(folder); |
286 | } | 291 | } |
287 | } | 292 | } |
288 | 293 | ||
289 | /// <summary> | 294 | /// <summary> |