diff options
author | Teravus Ovares | 2008-05-24 11:10:21 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-05-24 11:10:21 +0000 |
commit | 375673ec903719f0225b182cb62aab153c86e04e (patch) | |
tree | 66ca3c7493119c47cc4488985f9535572a767e1c /OpenSim/Region/Environment/Scenes | |
parent | * Implements selected object return. (diff) | |
download | opensim-SC-375673ec903719f0225b182cb62aab153c86e04e.zip opensim-SC-375673ec903719f0225b182cb62aab153c86e04e.tar.gz opensim-SC-375673ec903719f0225b182cb62aab153c86e04e.tar.bz2 opensim-SC-375673ec903719f0225b182cb62aab153c86e04e.tar.xz |
This enables return from the parcel object owner display.
There's some oddness with the parcel counts, but if you can get past the oddness, you can return objects under an owner that you have permission to return.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | 51 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 1 |
2 files changed, 30 insertions, 22 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs index a284ba5..850962d 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs | |||
@@ -1690,31 +1690,32 @@ namespace OpenSim.Region.Environment.Scenes | |||
1690 | //returnstring += "</scene>\n"; | 1690 | //returnstring += "</scene>\n"; |
1691 | 1691 | ||
1692 | 1692 | ||
1693 | CachedUserInfo userInfo = | 1693 | |
1694 | CommsManager.UserProfileCacheService.GetUserDetails(AgentId); | ||
1695 | if (userInfo != null) | ||
1696 | { | ||
1697 | LLUUID folderID = LLUUID.Zero; | ||
1698 | |||
1699 | List<InventoryFolderBase> subrootfolders = userInfo.RootFolder.RequestListOfFolders(); | ||
1700 | foreach (InventoryFolderBase flder in subrootfolders) | ||
1701 | { | ||
1702 | if (flder.Name == "Lost And Found") | ||
1703 | { | ||
1704 | folderID = flder.ID; | ||
1705 | break; | ||
1706 | } | ||
1707 | } | ||
1708 | |||
1709 | if (folderID == LLUUID.Zero) | ||
1710 | { | ||
1711 | folderID = userInfo.RootFolder.ID; | ||
1712 | } | ||
1713 | 1694 | ||
1714 | bool permissionToDelete = false; | 1695 | bool permissionToDelete = false; |
1715 | 1696 | ||
1716 | for (int i = 0; i < returnobjects.Length; i++) | 1697 | for (int i = 0; i < returnobjects.Length; i++) |
1717 | { | 1698 | { |
1699 | CachedUserInfo userInfo = | ||
1700 | CommsManager.UserProfileCacheService.GetUserDetails(returnobjects[i].OwnerID); | ||
1701 | if (userInfo != null) | ||
1702 | { | ||
1703 | LLUUID folderID = LLUUID.Zero; | ||
1704 | |||
1705 | List<InventoryFolderBase> subrootfolders = userInfo.RootFolder.RequestListOfFolders(); | ||
1706 | foreach (InventoryFolderBase flder in subrootfolders) | ||
1707 | { | ||
1708 | if (flder.Name == "Lost And Found") | ||
1709 | { | ||
1710 | folderID = flder.ID; | ||
1711 | break; | ||
1712 | } | ||
1713 | } | ||
1714 | |||
1715 | if (folderID == LLUUID.Zero) | ||
1716 | { | ||
1717 | folderID = userInfo.RootFolder.ID; | ||
1718 | } | ||
1718 | permissionToDelete = ExternalChecks.ExternalChecksCanDeleteObject(returnobjects[i].UUID, AgentId); | 1719 | permissionToDelete = ExternalChecks.ExternalChecksCanDeleteObject(returnobjects[i].UUID, AgentId); |
1719 | 1720 | ||
1720 | // If the user doesn't have permission, go on to the next one. | 1721 | // If the user doesn't have permission, go on to the next one. |
@@ -1732,7 +1733,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1732 | 1733 | ||
1733 | InventoryItemBase item = new InventoryItemBase(); | 1734 | InventoryItemBase item = new InventoryItemBase(); |
1734 | item.Creator = returnobjects[i].RootPart.CreatorID; | 1735 | item.Creator = returnobjects[i].RootPart.CreatorID; |
1735 | item.Owner = AgentId; | 1736 | item.Owner = returnobjects[i].OwnerID; |
1736 | item.ID = LLUUID.Random(); | 1737 | item.ID = LLUUID.Random(); |
1737 | item.AssetID = asset.FullID; | 1738 | item.AssetID = asset.FullID; |
1738 | item.Description = asset.Description; | 1739 | item.Description = asset.Description; |
@@ -1768,7 +1769,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1768 | // TODO: add the new fields (Flags, Sale info, etc) | 1769 | // TODO: add the new fields (Flags, Sale info, etc) |
1769 | 1770 | ||
1770 | userInfo.AddItem(item); | 1771 | userInfo.AddItem(item); |
1771 | 1772 | ||
1773 | ScenePresence notifyUser = GetScenePresence(item.Owner); | ||
1774 | if (notifyUser != null) | ||
1775 | { | ||
1776 | notifyUser.ControllingClient.SendInventoryItemCreateUpdate(item); | ||
1777 | } | ||
1778 | |||
1772 | SceneObjectGroup ObjectDeleting = returnobjects[i]; | 1779 | SceneObjectGroup ObjectDeleting = returnobjects[i]; |
1773 | 1780 | ||
1774 | returnobjects[i] = null; | 1781 | returnobjects[i] = null; |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 71c5b18..a42bad5 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1660,6 +1660,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1660 | client.OnSetStartLocationRequest += SetHomeRezPoint; | 1660 | client.OnSetStartLocationRequest += SetHomeRezPoint; |
1661 | client.OnUndo += m_innerScene.HandleUndo; | 1661 | client.OnUndo += m_innerScene.HandleUndo; |
1662 | client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate; | 1662 | client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate; |
1663 | client.OnParcelReturnObjectsRequest += LandChannel.ReturnObjectsInParcel; | ||
1663 | 1664 | ||
1664 | // EventManager.TriggerOnNewClient(client); | 1665 | // EventManager.TriggerOnNewClient(client); |
1665 | } | 1666 | } |