aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-03-03 22:14:06 +0000
committerJustin Clark-Casey (justincc)2010-03-03 22:14:06 +0000
commitedb176447ba9cd6d29bd45d9b3714aa0dab9cbf9 (patch)
tree5cd33ef765c28d2265b4e119f78ca5a1104ca590 /OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
parentActually make EventManager.OnAttach() fire when an object is attached. Previ... (diff)
downloadopensim-SC_OLD-edb176447ba9cd6d29bd45d9b3714aa0dab9cbf9.zip
opensim-SC_OLD-edb176447ba9cd6d29bd45d9b3714aa0dab9cbf9.tar.gz
opensim-SC_OLD-edb176447ba9cd6d29bd45d9b3714aa0dab9cbf9.tar.bz2
opensim-SC_OLD-edb176447ba9cd6d29bd45d9b3714aa0dab9cbf9.tar.xz
Fix bug where approximately half the time, attachments would rez only their root prim until right clicked (or otherwise updated).
The root cause of this problem was that multiple ObjectUpdates were being sent on attachment which differed enough to confuse the client. Sometimes these would eliminate each other and sometimes not, depending on whether the scheduler looked at the queued updates. The solution here is to only schedule the ObjectUpdate once the attachment code has done all it needs to do.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.Inventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs44
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 6df25d6..5f3cd8c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1842,9 +1842,18 @@ namespace OpenSim.Region.Framework.Scenes
1842 EventManager.TriggerOnAttach(localID, itemID, avatarID); 1842 EventManager.TriggerOnAttach(localID, itemID, avatarID);
1843 } 1843 }
1844 1844
1845 public UUID RezSingleAttachment(IClientAPI remoteClient, UUID itemID, 1845 /// <summary>
1846 uint AttachmentPt) 1846 /// Called when the client receives a request to rez a single attachment on to the avatar from inventory
1847 /// (RezSingleAttachmentFromInv packet).
1848 /// </summary>
1849 /// <param name="remoteClient"></param>
1850 /// <param name="itemID"></param>
1851 /// <param name="AttachmentPt"></param>
1852 /// <returns></returns>
1853 public UUID RezSingleAttachment(IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
1847 { 1854 {
1855 m_log.DebugFormat("[USER INVENTORY]: Rezzing single attachment from item {0} for {1}", itemID, remoteClient.Name);
1856
1848 SceneObjectGroup att = m_sceneGraph.RezSingleAttachment(remoteClient, itemID, AttachmentPt); 1857 SceneObjectGroup att = m_sceneGraph.RezSingleAttachment(remoteClient, itemID, AttachmentPt);
1849 1858
1850 if (att == null) 1859 if (att == null)
@@ -1856,9 +1865,20 @@ namespace OpenSim.Region.Framework.Scenes
1856 return RezSingleAttachment(att, remoteClient, itemID, AttachmentPt); 1865 return RezSingleAttachment(att, remoteClient, itemID, AttachmentPt);
1857 } 1866 }
1858 1867
1859 public UUID RezSingleAttachment(SceneObjectGroup att, 1868 /// <summary>
1860 IClientAPI remoteClient, UUID itemID, uint AttachmentPt) 1869 /// Update the user inventory to reflect an attachment
1870 /// </summary>
1871 /// <param name="att"></param>
1872 /// <param name="remoteClient"></param>
1873 /// <param name="itemID"></param>
1874 /// <param name="AttachmentPt"></param>
1875 /// <returns></returns>
1876 public UUID RezSingleAttachment(SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt)
1861 { 1877 {
1878 m_log.DebugFormat(
1879 "[USER INVENTORY]: Updating inventory of {0} to show attachment of {1} (item ID {2})",
1880 remoteClient.Name, att.Name, itemID);
1881
1862 if (!att.IsDeleted) 1882 if (!att.IsDeleted)
1863 AttachmentPt = att.RootPart.AttachmentPoint; 1883 AttachmentPt = att.RootPart.AttachmentPoint;
1864 1884
@@ -1897,8 +1917,19 @@ namespace OpenSim.Region.Framework.Scenes
1897 return m_sceneGraph.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent); 1917 return m_sceneGraph.AttachObject(controllingClient, localID, attachPoint, rot, pos, silent);
1898 } 1918 }
1899 1919
1920 /// <summary>
1921 /// This registers the item as attached in a user's inventory
1922 /// </summary>
1923 /// <param name="remoteClient"></param>
1924 /// <param name="AttachmentPt"></param>
1925 /// <param name="itemID"></param>
1926 /// <param name="att"></param>
1900 public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att) 1927 public void AttachObject(IClientAPI remoteClient, uint AttachmentPt, UUID itemID, SceneObjectGroup att)
1901 { 1928 {
1929// m_log.DebugFormat(
1930// "[USER INVENTORY]: Updating attachment {0} for {1} at {2} using item ID {3}",
1931// att.Name, remoteClient.Name, AttachmentPt, itemID);
1932
1902 if (UUID.Zero == itemID) 1933 if (UUID.Zero == itemID)
1903 { 1934 {
1904 m_log.Error("[SCENE INVENTORY]: Unable to save attachment. Error inventory item ID."); 1935 m_log.Error("[SCENE INVENTORY]: Unable to save attachment. Error inventory item ID.");
@@ -1926,10 +1957,7 @@ namespace OpenSim.Region.Framework.Scenes
1926 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */); 1957 presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */);
1927 1958
1928 if (m_AvatarFactory != null) 1959 if (m_AvatarFactory != null)
1929 {
1930 m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); 1960 m_AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
1931 }
1932
1933 } 1961 }
1934 } 1962 }
1935 1963
@@ -2012,6 +2040,7 @@ namespace OpenSim.Region.Framework.Scenes
2012 { 2040 {
2013 sog.SetOwnerId(ownerID); 2041 sog.SetOwnerId(ownerID);
2014 sog.SetGroup(groupID, remoteClient); 2042 sog.SetGroup(groupID, remoteClient);
2043 sog.ScheduleGroupForFullUpdate();
2015 2044
2016 foreach (SceneObjectPart child in sog.Children.Values) 2045 foreach (SceneObjectPart child in sog.Children.Values)
2017 child.Inventory.ChangeInventoryOwner(ownerID); 2046 child.Inventory.ChangeInventoryOwner(ownerID);
@@ -2033,6 +2062,7 @@ namespace OpenSim.Region.Framework.Scenes
2033 sog.SetOwnerId(groupID); 2062 sog.SetOwnerId(groupID);
2034 sog.ApplyNextOwnerPermissions(); 2063 sog.ApplyNextOwnerPermissions();
2035 } 2064 }
2065
2036 } 2066 }
2037 2067
2038 foreach (uint localID in localIDs) 2068 foreach (uint localID in localIDs)