aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/InventoryService/XInventoryService.cs
diff options
context:
space:
mode:
authorteravus2012-11-15 10:05:16 -0500
committerteravus2012-11-15 10:05:16 -0500
commite9153e1d1aae50024d8cd05fe14a9bce34343a0e (patch)
treebc111d34f95a26b99c7e34d9e495dc14d1802cc3 /OpenSim/Services/InventoryService/XInventoryService.cs
parentMerge master into teravuswork (diff)
downloadopensim-SC-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.zip
opensim-SC-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.tar.gz
opensim-SC-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.tar.bz2
opensim-SC-e9153e1d1aae50024d8cd05fe14a9bce34343a0e.tar.xz
Revert "Merge master into teravuswork", it should have been avination, not master.
This reverts commit dfac269032300872c4d0dc507f4f9062d102b0f4, reversing changes made to 619c39e5144f15aca129d6d999bcc5c34133ee64.
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs65
1 files changed, 15 insertions, 50 deletions
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index 309dab4..7518b86 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -94,7 +94,6 @@ namespace OpenSim.Services.InventoryService
94 94
95 m_Database = LoadPlugin<IXInventoryData>(dllName, 95 m_Database = LoadPlugin<IXInventoryData>(dllName,
96 new Object[] {connString, String.Empty}); 96 new Object[] {connString, String.Empty});
97
98 if (m_Database == null) 97 if (m_Database == null)
99 throw new Exception("Could not find a storage interface in the given module"); 98 throw new Exception("Could not find a storage interface in the given module");
100 } 99 }
@@ -230,28 +229,10 @@ namespace OpenSim.Services.InventoryService
230 public virtual InventoryFolderBase GetFolderForType(UUID principalID, AssetType type) 229 public virtual InventoryFolderBase GetFolderForType(UUID principalID, AssetType type)
231 { 230 {
232// m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0} for user {1}", type, principalID); 231// m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0} for user {1}", type, principalID);
233
234 InventoryFolderBase rootFolder = GetRootFolder(principalID);
235
236 if (rootFolder == null)
237 {
238 m_log.WarnFormat(
239 "[XINVENTORY]: Found no root folder for {0} in GetFolderForType() when looking for {1}",
240 principalID, type);
241
242 return null;
243 }
244
245 return GetSystemFolderForType(rootFolder, type);
246 }
247
248 private InventoryFolderBase GetSystemFolderForType(InventoryFolderBase rootFolder, AssetType type)
249 {
250// m_log.DebugFormat("[XINVENTORY SERVICE]: Getting folder type {0} for user {1}", type, principalID);
251 232
252 XInventoryFolder[] folders = m_Database.GetFolders( 233 XInventoryFolder[] folders = m_Database.GetFolders(
253 new string[] { "agentID", "parentFolderID", "type"}, 234 new string[] { "agentID", "type"},
254 new string[] { rootFolder.Owner.ToString(), rootFolder.ID.ToString(), ((int)type).ToString() }); 235 new string[] { principalID.ToString(), ((int)type).ToString() });
255 236
256 if (folders.Length == 0) 237 if (folders.Length == 0)
257 { 238 {
@@ -327,38 +308,22 @@ namespace OpenSim.Services.InventoryService
327 if (check != null) 308 if (check != null)
328 return false; 309 return false;
329 310
330 if (folder.Type != (short)AssetType.Folder && folder.Type != (short)AssetType.Unknown) 311 if (folder.Type == (short)AssetType.Folder
312 || folder.Type == (short)AssetType.Unknown
313 || folder.Type == (short)AssetType.OutfitFolder
314 || GetFolderForType(folder.Owner, (AssetType)(folder.Type)) == null)
331 { 315 {
332 InventoryFolderBase rootFolder = GetRootFolder(folder.Owner); 316 XInventoryFolder xFolder = ConvertFromOpenSim(folder);
333 317 return m_Database.StoreFolder(xFolder);
334 if (rootFolder == null) 318 }
335 { 319 else
336 m_log.WarnFormat( 320 {
337 "[XINVENTORY]: Found no root folder for {0} in AddFolder() when looking for {1}", 321 m_log.WarnFormat(
338 folder.Owner, folder.Type); 322 "[XINVENTORY]: Folder of type {0} already exists when tried to add {1} to {2} for {3}",
339 323 folder.Type, folder.Name, folder.ParentID, folder.Owner);
340 return false;
341 }
342
343 // Check we're not trying to add this as a system folder.
344 if (folder.ParentID == rootFolder.ID)
345 {
346 InventoryFolderBase existingSystemFolder
347 = GetSystemFolderForType(rootFolder, (AssetType)folder.Type);
348
349 if (existingSystemFolder != null)
350 {
351 m_log.WarnFormat(
352 "[XINVENTORY]: System folder of type {0} already exists when tried to add {1} to {2} for {3}",
353 folder.Type, folder.Name, folder.ParentID, folder.Owner);
354
355 return false;
356 }
357 }
358 } 324 }
359 325
360 XInventoryFolder xFolder = ConvertFromOpenSim(folder); 326 return false;
361 return m_Database.StoreFolder(xFolder);
362 } 327 }
363 328
364 public virtual bool UpdateFolder(InventoryFolderBase folder) 329 public virtual bool UpdateFolder(InventoryFolderBase folder)