aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/InventoryService/XInventoryService.cs
diff options
context:
space:
mode:
authorBlueWall2012-11-25 17:03:14 -0500
committerBlueWall2012-11-25 17:03:14 -0500
commitc754003944d0166bf50b4f94b0c0eea642503bb0 (patch)
treedfa1c2020d5500d510519d5b2b3236600692f277 /OpenSim/Services/InventoryService/XInventoryService.cs
parentMerge branch 'master' into connector_plugin (diff)
parentCombine TestDeleteSceneObjectAsync() with TestDeRezSceneObject() as they are ... (diff)
downloadopensim-SC-c754003944d0166bf50b4f94b0c0eea642503bb0.zip
opensim-SC-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.gz
opensim-SC-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.bz2
opensim-SC-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.xz
Merge branch 'master' into connector_plugin
Conflicts: OpenSim/Server/Base/ServicesServerBase.cs
Diffstat (limited to 'OpenSim/Services/InventoryService/XInventoryService.cs')
-rw-r--r--OpenSim/Services/InventoryService/XInventoryService.cs51
1 files changed, 41 insertions, 10 deletions
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs
index 309dab4..00faa44 100644
--- a/OpenSim/Services/InventoryService/XInventoryService.cs
+++ b/OpenSim/Services/InventoryService/XInventoryService.cs
@@ -400,16 +400,7 @@ namespace OpenSim.Services.InventoryService
400 400
401 public virtual bool MoveFolder(InventoryFolderBase folder) 401 public virtual bool MoveFolder(InventoryFolderBase folder)
402 { 402 {
403 XInventoryFolder[] x = m_Database.GetFolders( 403 return m_Database.MoveFolder(folder.ID.ToString(), folder.ParentID.ToString());
404 new string[] { "folderID" },
405 new string[] { folder.ID.ToString() });
406
407 if (x.Length == 0)
408 return false;
409
410 x[0].parentFolderID = folder.ParentID;
411
412 return m_Database.StoreFolder(x[0]);
413 } 404 }
414 405
415 // We don't check the principal's ID here 406 // We don't check the principal's ID here
@@ -485,6 +476,46 @@ namespace OpenSim.Services.InventoryService
485// m_log.InfoFormat( 476// m_log.InfoFormat(
486// "[XINVENTORY SERVICE]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder); 477// "[XINVENTORY SERVICE]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder);
487 478
479 InventoryItemBase retrievedItem = GetItem(item);
480
481 if (retrievedItem == null)
482 {
483 m_log.WarnFormat(
484 "[XINVENTORY SERVICE]: Tried to update item {0} {1}, owner {2} but no existing item found.",
485 item.Name, item.ID, item.Owner);
486
487 return false;
488 }
489
490 // Do not allow invariants to change. Changes to folder ID occur in MoveItems()
491 if (retrievedItem.InvType != item.InvType
492 || retrievedItem.AssetType != item.AssetType
493 || retrievedItem.Folder != item.Folder
494 || retrievedItem.CreatorIdentification != item.CreatorIdentification
495 || retrievedItem.Owner != item.Owner)
496 {
497 m_log.WarnFormat(
498 "[XINVENTORY SERVICE]: Caller to UpdateItem() for {0} {1} tried to alter property(s) that should be invariant, (InvType, AssetType, Folder, CreatorIdentification, Owner), existing ({2}, {3}, {4}, {5}, {6}), update ({7}, {8}, {9}, {10}, {11})",
499 retrievedItem.Name,
500 retrievedItem.ID,
501 retrievedItem.InvType,
502 retrievedItem.AssetType,
503 retrievedItem.Folder,
504 retrievedItem.CreatorIdentification,
505 retrievedItem.Owner,
506 item.InvType,
507 item.AssetType,
508 item.Folder,
509 item.CreatorIdentification,
510 item.Owner);
511
512 item.InvType = retrievedItem.InvType;
513 item.AssetType = retrievedItem.AssetType;
514 item.Folder = retrievedItem.Folder;
515 item.CreatorIdentification = retrievedItem.CreatorIdentification;
516 item.Owner = retrievedItem.Owner;
517 }
518
488 return m_Database.StoreItem(ConvertFromOpenSim(item)); 519 return m_Database.StoreItem(ConvertFromOpenSim(item));
489 } 520 }
490 521