aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/InventoryService/XInventoryService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/InventoryService/XInventoryService.cs')
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs21
1 files changed, 15 insertions, 6 deletions
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index eed88bd..3355428 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -302,7 +302,8 @@ namespace OpenSim.Services.InventoryService
302 302
303 public virtual bool AddFolder(InventoryFolderBase folder) 303 public virtual bool AddFolder(InventoryFolderBase folder)
304 { 304 {
305 //m_log.DebugFormat("[XINVENTORY]: Add folder {0} type {1} in parent {2}", folder.Name, folder.Type, folder.ParentID); 305// m_log.DebugFormat("[XINVENTORY]: Add folder {0} type {1} in parent {2}", folder.Name, folder.Type, folder.ParentID);
306
306 InventoryFolderBase check = GetFolder(folder); 307 InventoryFolderBase check = GetFolder(folder);
307 if (check != null) 308 if (check != null)
308 return false; 309 return false;
@@ -327,27 +328,36 @@ namespace OpenSim.Services.InventoryService
327 328
328 public virtual bool UpdateFolder(InventoryFolderBase folder) 329 public virtual bool UpdateFolder(InventoryFolderBase folder)
329 { 330 {
330 //m_log.DebugFormat("[XINVENTORY]: Update folder {0} {1} ({2})", folder.Name, folder.Type, folder.ID); 331// m_log.DebugFormat("[XINVENTORY]: Update folder {0} {1} ({2})", folder.Name, folder.Type, folder.ID);
332
331 XInventoryFolder xFolder = ConvertFromOpenSim(folder); 333 XInventoryFolder xFolder = ConvertFromOpenSim(folder);
332 InventoryFolderBase check = GetFolder(folder); 334 InventoryFolderBase check = GetFolder(folder);
335
333 if (check == null) 336 if (check == null)
334 return AddFolder(folder); 337 return AddFolder(folder);
335 338
336 if (check.Type != -1 || xFolder.type != -1) 339 if ((check.Type != (short)AssetType.Unknown || xFolder.type != (short)AssetType.Unknown)
340 && (check.Type != (short)AssetType.OutfitFolder || xFolder.type != (short)AssetType.OutfitFolder))
337 { 341 {
338 if (xFolder.version < check.Version) 342 if (xFolder.version < check.Version)
339 { 343 {
340 //m_log.DebugFormat("[XINVENTORY]: {0} < {1} can't do", xFolder.version, check.Version); 344// m_log.DebugFormat("[XINVENTORY]: {0} < {1} can't do", xFolder.version, check.Version);
341 return false; 345 return false;
342 } 346 }
347
343 check.Version = (ushort)xFolder.version; 348 check.Version = (ushort)xFolder.version;
344 xFolder = ConvertFromOpenSim(check); 349 xFolder = ConvertFromOpenSim(check);
345 //m_log.DebugFormat("[XINVENTORY]: Storing {0} {1} {2}", xFolder.folderName, xFolder.version, xFolder.type); 350
351// m_log.DebugFormat(
352// "[XINVENTORY]: Storing version only update to system folder {0} {1} {2}",
353// xFolder.folderName, xFolder.version, xFolder.type);
354
346 return m_Database.StoreFolder(xFolder); 355 return m_Database.StoreFolder(xFolder);
347 } 356 }
348 357
349 if (xFolder.version < check.Version) 358 if (xFolder.version < check.Version)
350 xFolder.version = check.Version; 359 xFolder.version = check.Version;
360
351 xFolder.folderID = check.ID; 361 xFolder.folderID = check.ID;
352 362
353 return m_Database.StoreFolder(xFolder); 363 return m_Database.StoreFolder(xFolder);
@@ -433,7 +443,6 @@ namespace OpenSim.Services.InventoryService
433 443
434 public virtual bool UpdateItem(InventoryItemBase item) 444 public virtual bool UpdateItem(InventoryItemBase item)
435 { 445 {
436// throw new Exception("urrgh");
437 if (!m_AllowDelete) 446 if (!m_AllowDelete)
438 if (item.AssetType == (sbyte)AssetType.Link || item.AssetType == (sbyte)AssetType.LinkFolder) 447 if (item.AssetType == (sbyte)AssetType.Link || item.AssetType == (sbyte)AssetType.LinkFolder)
439 return false; 448 return false;