diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 44 |
1 files changed, 37 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index e458ecf..9cbaffc 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1846,9 +1846,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
1846 | EventManager.TriggerOnAttach(localID, itemID, avatarID); | 1846 | EventManager.TriggerOnAttach(localID, itemID, avatarID); |
1847 | } | 1847 | } |
1848 | 1848 | ||
1849 | public UUID RezSingleAttachment(IClientAPI remoteClient, UUID itemID, | 1849 | /// <summary> |
1850 | uint AttachmentPt) | 1850 | /// Called when the client receives a request to rez a single attachment on to the avatar from inventory |
1851 | /// (RezSingleAttachmentFromInv packet). | ||
1852 | /// </summary> | ||
1853 | /// <param name="remoteClient"></param> | ||
1854 | /// <param name="itemID"></param> | ||
1855 | /// <param name="AttachmentPt"></param> | ||
1856 | /// <returns></returns> | ||
1857 | public UUID RezSingleAttachment(IClientAPI remoteClient, UUID itemID, uint AttachmentPt) | ||
1851 | { | 1858 | { |
1859 | m_log.DebugFormat("[USER INVENTORY]: Rezzing single attachment from item {0} for {1}", itemID, remoteClient.Name); | ||
1860 | |||
1852 | SceneObjectGroup att = m_sceneGraph.RezSingleAttachment(remoteClient, itemID, AttachmentPt); | 1861 | SceneObjectGroup att = m_sceneGraph.RezSingleAttachment(remoteClient, itemID, AttachmentPt); |
1853 | 1862 | ||
1854 | if (att == null) | 1863 | if (att == null) |
@@ -1860,9 +1869,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
1860 | return RezSingleAttachment(att, remoteClient, itemID, AttachmentPt); | 1869 | return RezSingleAttachment(att, remoteClient, itemID, AttachmentPt); |
1861 | } | 1870 | } |
1862 | 1871 | ||
1863 | public UUID RezSingleAttachment(SceneObjectGroup att, | 1872 | /// <summary> |
1864 | IClientAPI remoteClient, UUID itemID, uint AttachmentPt) | 1873 | /// Update the user inventory to reflect an attachment |
1874 | /// </summary> | ||
1875 | /// <param name="att"></param> | ||
1876 | /// <param name="remoteClient"></param> | ||
1877 | /// <param name="itemID"></param> | ||
1878 | /// <param name="AttachmentPt"></param> | ||
1879 | /// <returns></returns> | ||
1880 | public UUID RezSingleAttachment(SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt) | ||
1865 | { | 1881 | { |
1882 | m_log.DebugFormat( | ||
1883 | "[USER INVENTORY]: Updating inventory of {0} to show attachment of {1} (item ID {2})", | ||
1884 | remoteClient.Name, att.Name, itemID); | ||
1885 | |||
1866 | if (!att.IsDeleted) | 1886 | if (!att.IsDeleted) |
1867 | AttachmentPt = att.RootPart.AttachmentPoint; | 1887 | AttachmentPt = att.RootPart.AttachmentPoint; |
1868 | 1888 | ||
@@ -1901,8 +1921,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1901 | return m_sceneGraph.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent); | 1921 | return m_sceneGraph.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent); |
1902 | } | 1922 | } |
1903 | 1923 | ||
1924 | /// <summary> | ||
1925 | /// This registers the item as attached in a user's inventory | ||
1926 | /// </summary> | ||
1927 | /// <param name="remoteClient"></param> | ||
1928 | /// <param name="AttachmentPt"></param> | ||
1929 | /// <param name="itemID"></param> | ||
1930 | /// <param name="att"></param> | ||
1904 | public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att) | 1931 | public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att) |
1905 | { | 1932 | { |
1933 | // m_log.DebugFormat( | ||
1934 | // "[USER INVENTORY]: Updating attachment {0} for {1} at {2} using item ID {3}", | ||
1935 | // att.Name, remoteClient.Name, AttachmentPt, itemID); | ||
1936 | |||
1906 | if (UUID.Zero == itemID) | 1937 | if (UUID.Zero == itemID) |
1907 | { | 1938 | { |
1908 | m_log.Error("[SCENE INVENTORY]: Unable to save attachment. Error inventory item ID."); | 1939 | m_log.Error("[SCENE INVENTORY]: Unable to save attachment. Error inventory item ID."); |
@@ -1930,10 +1961,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1930 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); | 1961 | presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); |
1931 | 1962 | ||
1932 | if (m_AvatarFactory != null) | 1963 | if (m_AvatarFactory != null) |
1933 | { | ||
1934 | m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); | 1964 | m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); |
1935 | } | ||
1936 | |||
1937 | } | 1965 | } |
1938 | } | 1966 | } |
1939 | 1967 | ||
@@ -2016,6 +2044,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2016 | { | 2044 | { |
2017 | sog.SetOwnerId(ownerID); | 2045 | sog.SetOwnerId(ownerID); |
2018 | sog.SetGroup(groupID, remoteClient); | 2046 | sog.SetGroup(groupID, remoteClient); |
2047 | sog.ScheduleGroupForFullUpdate(); | ||
2019 | 2048 | ||
2020 | foreach (SceneObjectPart child in sog.Children.Values) | 2049 | foreach (SceneObjectPart child in sog.Children.Values) |
2021 | child.Inventory.ChangeInventoryOwner(ownerID); | 2050 | child.Inventory.ChangeInventoryOwner(ownerID); |
@@ -2037,6 +2066,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2037 | sog.SetOwnerId(groupID); | 2066 | sog.SetOwnerId(groupID); |
2038 | sog.ApplyNextOwnerPermissions(); | 2067 | sog.ApplyNextOwnerPermissions(); |
2039 | } | 2068 | } |
2069 | |||
2040 | } | 2070 | } |
2041 | 2071 | ||
2042 | foreach (uint localID in localIDs) | 2072 | foreach (uint localID in localIDs) |