コード例 #1
0
        public void MoveItem(UUID userId, UUID itemId, UUID parentFolderId)
        {
            InventoryItemBase   item   = _storage.GetItem(itemId, UUID.Zero);
            InventoryFolderBase folder = _storage.GetFolderAttributes(parentFolderId);

            if (item == null)
            {
                throw new InventoryObjectMissingException(String.Format("Not moving null item for user {0}. The item could not be found", userId));
            }

            if (folder == null)
            {
                throw new InventoryObjectMissingException(String.Format("Not moving item {0} for user {1}. The destination folder could not be found", item.ID, userId));
            }

            if (item.Owner != userId || item.Owner != folder.Owner)
            {
                throw new InventorySecurityException(String.Format("Not moving item {0} for user {1}. User does not own the item or destination folder", item.ID, userId));
            }

            _storage.MoveItem(item, folder);
        }