diff options
Diffstat (limited to 'OpenSim/Services/InventoryService/XInventoryService.cs')
-rw-r--r-- | OpenSim/Services/InventoryService/XInventoryService.cs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 9abc5e4..00faa44 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs | |||
@@ -476,6 +476,46 @@ namespace OpenSim.Services.InventoryService | |||
476 | // m_log.InfoFormat( | 476 | // m_log.InfoFormat( |
477 | // "[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); |
478 | 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 | |||
479 | return m_Database.StoreItem(ConvertFromOpenSim(item)); | 519 | return m_Database.StoreItem(ConvertFromOpenSim(item)); |
480 | } | 520 | } |
481 | 521 | ||