diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index ff4abc7bc5..35618dbcec 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs @@ -158,7 +158,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) + public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) { CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); if (userInfo != null) @@ -405,7 +405,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// ID of the sender of the item /// - public void GiveInventoryItem(IClientAPI recipientClient, UUID senderId, UUID itemId) + public virtual void GiveInventoryItem(IClientAPI recipientClient, UUID senderId, UUID itemId) { // Retrieve the item from the sender CachedUserInfo senderUserInfo = CommsManager.UserProfileCacheService.GetUserDetails(senderId); @@ -1607,6 +1607,7 @@ namespace OpenSim.Region.Environment.Scenes /// /// Delete a scene object from a scene and place in the given avatar's inventory. + /// Returns the UUID of the newly created asset. /// /// /// @@ -1614,10 +1615,12 @@ namespace OpenSim.Region.Environment.Scenes /// /// /// - public void DeleteToInventory(int destination, UUID folderID, + public virtual UUID DeleteToInventory(int destination, UUID folderID, SceneObjectGroup objectGroup, IClientAPI remoteClient, bool permissionToDelete) { + UUID assetID = UUID.Zero; + string sceneObjectXml = objectGroup.ToXmlString(); CachedUserInfo userInfo; @@ -1661,7 +1664,7 @@ namespace OpenSim.Region.Environment.Scenes { CommsManager.UserProfileCacheService.RequestInventoryForUser(objectGroup.RootPart.OwnerID); m_log.WarnFormat("[SCENE] Can't find root folder for user, requesting inventory"); - return; + return assetID; } } } @@ -1672,6 +1675,7 @@ namespace OpenSim.Region.Environment.Scenes (sbyte)AssetType.Object, Utils.StringToBytes(sceneObjectXml)); AssetCache.AddAsset(asset); + assetID = asset.FullID; InventoryItemBase item = new InventoryItemBase(); item.Creator = objectGroup.RootPart.CreatorID; @@ -1736,6 +1740,8 @@ namespace OpenSim.Region.Environment.Scenes // Finally remove the item, for reals this time. if (permissionToDelete) DeleteSceneObject(objectGroup, false); + + return assetID; } public void updateKnownAsset(IClientAPI remoteClient, SceneObjectGroup grp, UUID assetID, UUID agentID)