aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorCharles Krinke2008-11-11 15:18:16 +0000
committerCharles Krinke2008-11-11 15:18:16 +0000
commit851b72570a561a24f39dc72684e354144ed79f00 (patch)
treee56170223b12ff75e985f4c10d4259ab114beb20 /OpenSim/Region
parentIf the proxy is on, we need to ignore the extra 6 bytes in the packet. (diff)
downloadopensim-SC_OLD-851b72570a561a24f39dc72684e354144ed79f00.zip
opensim-SC_OLD-851b72570a561a24f39dc72684e354144ed79f00.tar.gz
opensim-SC_OLD-851b72570a561a24f39dc72684e354144ed79f00.tar.bz2
opensim-SC_OLD-851b72570a561a24f39dc72684e354144ed79f00.tar.xz
Mantis#2604. Thank you kindly, Diva for a patch that:
This patch changes a couple of methods in Scene.Inventory to virtual, so they can be overridden in subclasses. DeleteToInventory now returns the UUID of the newly created asset, so that further actions on it can be pursued in subclasses. This will make my life easier for making inventory accessible in the hypergrid.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs14
1 files changed, 10 insertions, 4 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index ff4abc7..35618db 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
158 /// <param name="itemID"></param> 158 /// <param name="itemID"></param>
159 /// <param name="data"></param> 159 /// <param name="data"></param>
160 /// <returns></returns> 160 /// <returns></returns>
161 public UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) 161 public virtual UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data)
162 { 162 {
163 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); 163 CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
164 if (userInfo != null) 164 if (userInfo != null)
@@ -405,7 +405,7 @@ namespace OpenSim.Region.Environment.Scenes
405 /// <param name="recipientClient"></param> 405 /// <param name="recipientClient"></param>
406 /// <param name="senderId">ID of the sender of the item</param> 406 /// <param name="senderId">ID of the sender of the item</param>
407 /// <param name="itemId"></param> 407 /// <param name="itemId"></param>
408 public void GiveInventoryItem(IClientAPI recipientClient, UUID senderId, UUID itemId) 408 public virtual void GiveInventoryItem(IClientAPI recipientClient, UUID senderId, UUID itemId)
409 { 409 {
410 // Retrieve the item from the sender 410 // Retrieve the item from the sender
411 CachedUserInfo senderUserInfo = CommsManager.UserProfileCacheService.GetUserDetails(senderId); 411 CachedUserInfo senderUserInfo = CommsManager.UserProfileCacheService.GetUserDetails(senderId);
@@ -1607,6 +1607,7 @@ namespace OpenSim.Region.Environment.Scenes
1607 1607
1608 /// <summary> 1608 /// <summary>
1609 /// Delete a scene object from a scene and place in the given avatar's inventory. 1609 /// Delete a scene object from a scene and place in the given avatar's inventory.
1610 /// Returns the UUID of the newly created asset.
1610 /// </summary> 1611 /// </summary>
1611 /// <param name="DeRezPacket"></param> 1612 /// <param name="DeRezPacket"></param>
1612 /// <param name="selectedEnt"></param> 1613 /// <param name="selectedEnt"></param>
@@ -1614,10 +1615,12 @@ namespace OpenSim.Region.Environment.Scenes
1614 /// <param name="objectGroup"></param> 1615 /// <param name="objectGroup"></param>
1615 /// <param name="folderID"></param> 1616 /// <param name="folderID"></param>
1616 /// <param name="permissionToDelete"></param> 1617 /// <param name="permissionToDelete"></param>
1617 public void DeleteToInventory(int destination, UUID folderID, 1618 public virtual UUID DeleteToInventory(int destination, UUID folderID,
1618 SceneObjectGroup objectGroup, IClientAPI remoteClient, 1619 SceneObjectGroup objectGroup, IClientAPI remoteClient,
1619 bool permissionToDelete) 1620 bool permissionToDelete)
1620 { 1621 {
1622 UUID assetID = UUID.Zero;
1623
1621 string sceneObjectXml = objectGroup.ToXmlString(); 1624 string sceneObjectXml = objectGroup.ToXmlString();
1622 1625
1623 CachedUserInfo userInfo; 1626 CachedUserInfo userInfo;
@@ -1661,7 +1664,7 @@ namespace OpenSim.Region.Environment.Scenes
1661 { 1664 {
1662 CommsManager.UserProfileCacheService.RequestInventoryForUser(objectGroup.RootPart.OwnerID); 1665 CommsManager.UserProfileCacheService.RequestInventoryForUser(objectGroup.RootPart.OwnerID);
1663 m_log.WarnFormat("[SCENE] Can't find root folder for user, requesting inventory"); 1666 m_log.WarnFormat("[SCENE] Can't find root folder for user, requesting inventory");
1664 return; 1667 return assetID;
1665 } 1668 }
1666 } 1669 }
1667 } 1670 }
@@ -1672,6 +1675,7 @@ namespace OpenSim.Region.Environment.Scenes
1672 (sbyte)AssetType.Object, 1675 (sbyte)AssetType.Object,
1673 Utils.StringToBytes(sceneObjectXml)); 1676 Utils.StringToBytes(sceneObjectXml));
1674 AssetCache.AddAsset(asset); 1677 AssetCache.AddAsset(asset);
1678 assetID = asset.FullID;
1675 1679
1676 InventoryItemBase item = new InventoryItemBase(); 1680 InventoryItemBase item = new InventoryItemBase();
1677 item.Creator = objectGroup.RootPart.CreatorID; 1681 item.Creator = objectGroup.RootPart.CreatorID;
@@ -1736,6 +1740,8 @@ namespace OpenSim.Region.Environment.Scenes
1736 // Finally remove the item, for reals this time. 1740 // Finally remove the item, for reals this time.
1737 if (permissionToDelete) 1741 if (permissionToDelete)
1738 DeleteSceneObject(objectGroup, false); 1742 DeleteSceneObject(objectGroup, false);
1743
1744 return assetID;
1739 } 1745 }
1740 1746
1741 public void updateKnownAsset(IClientAPI remoteClient, SceneObjectGroup grp, UUID assetID, UUID agentID) 1747 public void updateKnownAsset(IClientAPI remoteClient, SceneObjectGroup grp, UUID assetID, UUID agentID)