diff options
author | Justin Clark-Casey (justincc) | 2010-03-03 22:14:06 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-03-09 18:53:04 +0000 |
commit | 5caae0293ab0f69cced21923c36db230698c7970 (patch) | |
tree | d9aadd6f5e7b159386e8633660955ee2805a5d2d /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | Small consistency change (diff) | |
download | opensim-SC-5caae0293ab0f69cced21923c36db230698c7970.zip opensim-SC-5caae0293ab0f69cced21923c36db230698c7970.tar.gz opensim-SC-5caae0293ab0f69cced21923c36db230698c7970.tar.bz2 opensim-SC-5caae0293ab0f69cced21923c36db230698c7970.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.
Backport from head.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 41fd1e1..7796b8d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1813,14 +1813,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
1813 | //m_log.DebugFormat( | 1813 | //m_log.DebugFormat( |
1814 | // "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName); | 1814 | // "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName); |
1815 | 1815 | ||
1816 | SceneObjectGroup sceneObject = null; | ||
1817 | |||
1816 | // If an entity creator has been registered for this prim type then use that | 1818 | // If an entity creator has been registered for this prim type then use that |
1817 | if (m_entityCreators.ContainsKey((PCode)shape.PCode)) | 1819 | if (m_entityCreators.ContainsKey((PCode)shape.PCode)) |
1818 | return m_entityCreators[(PCode)shape.PCode].CreateEntity(ownerID, groupID, pos, rot, shape); | 1820 | { |
1821 | sceneObject = m_entityCreators[(PCode)shape.PCode].CreateEntity(ownerID, groupID, pos, rot, shape); | ||
1822 | } | ||
1823 | else | ||
1824 | { | ||
1825 | // Otherwise, use this default creation code; | ||
1826 | sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); | ||
1827 | AddNewSceneObject(sceneObject, true); | ||
1828 | sceneObject.SetGroup(groupID, null); | ||
1829 | } | ||
1819 | 1830 | ||
1820 | // Otherwise, use this default creation code; | 1831 | sceneObject.ScheduleGroupForFullUpdate(); |
1821 | SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); | ||
1822 | AddNewSceneObject(sceneObject, true); | ||
1823 | sceneObject.SetGroup(groupID, null); | ||
1824 | 1832 | ||
1825 | return sceneObject; | 1833 | return sceneObject; |
1826 | } | 1834 | } |
@@ -1848,7 +1856,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1848 | } | 1856 | } |
1849 | 1857 | ||
1850 | /// <summary> | 1858 | /// <summary> |
1851 | /// Add a newly created object to the scene | 1859 | /// Add a newly created object to the scene. Updates are also sent to viewers. |
1852 | /// </summary> | 1860 | /// </summary> |
1853 | /// <param name="sceneObject"></param> | 1861 | /// <param name="sceneObject"></param> |
1854 | /// <param name="attachToBackup"> | 1862 | /// <param name="attachToBackup"> |
@@ -1857,8 +1865,25 @@ namespace OpenSim.Region.Framework.Scenes | |||
1857 | /// </param> | 1865 | /// </param> |
1858 | public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) | 1866 | public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) |
1859 | { | 1867 | { |
1860 | return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup); | 1868 | return AddNewSceneObject(sceneObject, attachToBackup, true); |
1861 | } | 1869 | } |
1870 | |||
1871 | /// <summary> | ||
1872 | /// Add a newly created object to the scene | ||
1873 | /// </summary> | ||
1874 | /// <param name="sceneObject"></param> | ||
1875 | /// <param name="attachToBackup"> | ||
1876 | /// If true, the object is made persistent into the scene. | ||
1877 | /// If false, the object will not persist over server restarts | ||
1878 | /// </param> | ||
1879 | /// <param name="sendClientUpdates"> | ||
1880 | /// If true, updates for the new scene object are sent to all viewers in range. | ||
1881 | /// If false, it is left to the caller to schedule the update | ||
1882 | /// </param> | ||
1883 | public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) | ||
1884 | { | ||
1885 | return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates); | ||
1886 | } | ||
1862 | 1887 | ||
1863 | /// <summary> | 1888 | /// <summary> |
1864 | /// Delete every object from the scene | 1889 | /// Delete every object from the scene |
@@ -3322,7 +3347,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3322 | } | 3347 | } |
3323 | else | 3348 | else |
3324 | m_log.Debug("[SCENE]: Unable to register with InterregionCommsIn"); | 3349 | m_log.Debug("[SCENE]: Unable to register with InterregionCommsIn"); |
3325 | |||
3326 | } | 3350 | } |
3327 | 3351 | ||
3328 | /// <summary> | 3352 | /// <summary> |