aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
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
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')
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs16
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs44
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs40
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs43
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs35
5 files changed, 140 insertions, 38 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index e0df288..0fc467b 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -411,6 +411,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
411 /// <summary> 411 /// <summary>
412 /// Rez an object into the scene from the user's inventory 412 /// Rez an object into the scene from the user's inventory
413 /// </summary> 413 /// </summary>
414 /// FIXME: It would be really nice if inventory access modules didn't also actually do the work of rezzing
415 /// things to the scene. The caller should be doing that, I think.
414 /// <param name="remoteClient"></param> 416 /// <param name="remoteClient"></param>
415 /// <param name="itemID"></param> 417 /// <param name="itemID"></param>
416 /// <param name="RayEnd"></param> 418 /// <param name="RayEnd"></param>
@@ -500,13 +502,17 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
500 group.RootPart.IsAttachment = true; 502 group.RootPart.IsAttachment = true;
501 } 503 }
502 504
503 m_Scene.AddNewSceneObject(group, true); 505 // For attachments, we must make sure that only a single object update occurs after we've finished
506 // all the necessary operations.
507 m_Scene.AddNewSceneObject(group, true, false);
504 508
505 // m_log.InfoFormat("ray end point for inventory rezz is {0} {1} {2} ", RayEnd.X, RayEnd.Y, RayEnd.Z); 509 // m_log.InfoFormat("ray end point for inventory rezz is {0} {1} {2} ", RayEnd.X, RayEnd.Y, RayEnd.Z);
506 // if attachment we set it's asset id so object updates can reflect that 510 // if attachment we set it's asset id so object updates can reflect that
507 // if not, we set it's position in world. 511 // if not, we set it's position in world.
508 if (!attachment) 512 if (!attachment)
509 { 513 {
514 group.ScheduleGroupForFullUpdate();
515
510 float offsetHeight = 0; 516 float offsetHeight = 0;
511 pos = m_Scene.GetNewRezLocation( 517 pos = m_Scene.GetNewRezLocation(
512 RayStart, RayEnd, RayTargetID, Quaternion.Identity, 518 RayStart, RayEnd, RayTargetID, Quaternion.Identity,
@@ -562,6 +568,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
562 part.GroupMask = 0; // DO NOT propagate here 568 part.GroupMask = 0; // DO NOT propagate here
563 } 569 }
564 } 570 }
571
565 group.ApplyNextOwnerPermissions(); 572 group.ApplyNextOwnerPermissions();
566 } 573 }
567 } 574 }
@@ -569,7 +576,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
569 foreach (SceneObjectPart part in partList) 576 foreach (SceneObjectPart part in partList)
570 { 577 {
571 if (part.OwnerID != item.Owner) 578 if (part.OwnerID != item.Owner)
572 { 579 {
573 part.LastOwnerID = part.OwnerID; 580 part.LastOwnerID = part.OwnerID;
574 part.OwnerID = item.Owner; 581 part.OwnerID = item.Owner;
575 part.Inventory.ChangeInventoryOwner(item.Owner); 582 part.Inventory.ChangeInventoryOwner(item.Owner);
@@ -591,10 +598,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
591 { 598 {
592 group.ClearPartAttachmentData(); 599 group.ClearPartAttachmentData();
593 } 600 }
594 } 601
595
596 if (!attachment)
597 {
598 // Fire on_rez 602 // Fire on_rez
599 group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 0); 603 group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 0);
600 604
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)
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 5e5a52e..a880fe7 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1906,14 +1906,22 @@ namespace OpenSim.Region.Framework.Scenes
1906 //m_log.DebugFormat( 1906 //m_log.DebugFormat(
1907 // "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName); 1907 // "[SCENE]: Scene.AddNewPrim() pcode {0} called for {1} in {2}", shape.PCode, ownerID, RegionInfo.RegionName);
1908 1908
1909 SceneObjectGroup sceneObject = null;
1910
1909 // If an entity creator has been registered for this prim type then use that 1911 // If an entity creator has been registered for this prim type then use that
1910 if (m_entityCreators.ContainsKey((PCode)shape.PCode)) 1912 if (m_entityCreators.ContainsKey((PCode)shape.PCode))
1911 return m_entityCreators[(PCode)shape.PCode].CreateEntity(ownerID, groupID, pos, rot, shape); 1913 {
1914 sceneObject = m_entityCreators[(PCode)shape.PCode].CreateEntity(ownerID, groupID, pos, rot, shape);
1915 }
1916 else
1917 {
1918 // Otherwise, use this default creation code;
1919 sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape);
1920 AddNewSceneObject(sceneObject, true);
1921 sceneObject.SetGroup(groupID, null);
1922 }
1912 1923
1913 // Otherwise, use this default creation code; 1924 sceneObject.ScheduleGroupForFullUpdate();
1914 SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape);
1915 AddNewSceneObject(sceneObject, true);
1916 sceneObject.SetGroup(groupID, null);
1917 1925
1918 return sceneObject; 1926 return sceneObject;
1919 } 1927 }
@@ -1941,7 +1949,7 @@ namespace OpenSim.Region.Framework.Scenes
1941 } 1949 }
1942 1950
1943 /// <summary> 1951 /// <summary>
1944 /// Add a newly created object to the scene 1952 /// Add a newly created object to the scene. Updates are also sent to viewers.
1945 /// </summary> 1953 /// </summary>
1946 /// <param name="sceneObject"></param> 1954 /// <param name="sceneObject"></param>
1947 /// <param name="attachToBackup"> 1955 /// <param name="attachToBackup">
@@ -1950,8 +1958,25 @@ namespace OpenSim.Region.Framework.Scenes
1950 /// </param> 1958 /// </param>
1951 public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) 1959 public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup)
1952 { 1960 {
1953 return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup); 1961 return AddNewSceneObject(sceneObject, attachToBackup, true);
1954 } 1962 }
1963
1964 /// <summary>
1965 /// Add a newly created object to the scene
1966 /// </summary>
1967 /// <param name="sceneObject"></param>
1968 /// <param name="attachToBackup">
1969 /// If true, the object is made persistent into the scene.
1970 /// If false, the object will not persist over server restarts
1971 /// </param>
1972 /// <param name="sendClientUpdates">
1973 /// If true, updates for the new scene object are sent to all viewers in range.
1974 /// If false, it is left to the caller to schedule the update
1975 /// </param>
1976 public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
1977 {
1978 return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates);
1979 }
1955 1980
1956 /// <summary> 1981 /// <summary>
1957 /// Delete every object from the scene 1982 /// Delete every object from the scene
@@ -3143,7 +3168,6 @@ namespace OpenSim.Region.Framework.Scenes
3143 m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; 3168 m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid;
3144 m_sceneGridService.KiPrimitive += SendKillObject; 3169 m_sceneGridService.KiPrimitive += SendKillObject;
3145 m_sceneGridService.OnGetLandData += GetLandData; 3170 m_sceneGridService.OnGetLandData += GetLandData;
3146
3147 } 3171 }
3148 3172
3149 /// <summary> 3173 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index b7fcd7d..22613e9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -229,7 +229,7 @@ namespace OpenSim.Region.Framework.Scenes
229 sceneObject.HasGroupChanged = true; 229 sceneObject.HasGroupChanged = true;
230 } 230 }
231 231
232 return AddSceneObject(sceneObject, attachToBackup); 232 return AddSceneObject(sceneObject, attachToBackup, true);
233 } 233 }
234 234
235 /// <summary> 235 /// <summary>
@@ -244,12 +244,12 @@ namespace OpenSim.Region.Framework.Scenes
244 /// <returns> 244 /// <returns>
245 /// true if the object was added, false if an object with the same uuid was already in the scene 245 /// true if the object was added, false if an object with the same uuid was already in the scene
246 /// </returns> 246 /// </returns>
247 protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) 247 protected internal bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
248 { 248 {
249 // Ensure that we persist this new scene object 249 // Ensure that we persist this new scene object
250 sceneObject.HasGroupChanged = true; 250 sceneObject.HasGroupChanged = true;
251 251
252 return AddSceneObject(sceneObject, attachToBackup); 252 return AddSceneObject(sceneObject, attachToBackup, sendClientUpdates);
253 } 253 }
254 254
255 /// <summary> 255 /// <summary>
@@ -261,12 +261,19 @@ namespace OpenSim.Region.Framework.Scenes
261 /// If true, the object is made persistent into the scene. 261 /// If true, the object is made persistent into the scene.
262 /// If false, the object will not persist over server restarts 262 /// If false, the object will not persist over server restarts
263 /// </param> 263 /// </param>
264 /// <returns>true if the object was added, false if an object with the same uuid was already in the scene 264 /// <param name="sendClientUpdates">
265 /// If true, updates for the new scene object are sent to all viewers in range.
266 /// If false, it is left to the caller to schedule the update
267 /// </param>
268 /// <returns>
269 /// true if the object was added, false if an object with the same uuid was already in the scene
265 /// </returns> 270 /// </returns>
266 protected bool AddSceneObject(SceneObjectGroup sceneObject, bool attachToBackup) 271 protected bool AddSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates)
267 { 272 {
268 if (sceneObject == null || sceneObject.RootPart == null || sceneObject.RootPart.UUID == UUID.Zero) 273 if (sceneObject == null || sceneObject.RootPart == null || sceneObject.RootPart.UUID == UUID.Zero)
269 return false; 274 return false;
275
276 bool alreadyExisted = false;
270 277
271 if (m_parentScene.m_clampPrimSize) 278 if (m_parentScene.m_clampPrimSize)
272 { 279 {
@@ -287,6 +294,9 @@ namespace OpenSim.Region.Framework.Scenes
287 294
288 sceneObject.AttachToScene(m_parentScene); 295 sceneObject.AttachToScene(m_parentScene);
289 296
297 if (sendClientUpdates)
298 sceneObject.ScheduleGroupForFullUpdate();
299
290 lock (sceneObject) 300 lock (sceneObject)
291 { 301 {
292 if (!Entities.ContainsKey(sceneObject.UUID)) 302 if (!Entities.ContainsKey(sceneObject.UUID))
@@ -310,12 +320,14 @@ namespace OpenSim.Region.Framework.Scenes
310 SceneObjectGroupsByLocalID[part.LocalId] = sceneObject; 320 SceneObjectGroupsByLocalID[part.LocalId] = sceneObject;
311 } 321 }
312 } 322 }
313 323 }
314 return true; 324 else
325 {
326 alreadyExisted = true;
315 } 327 }
316 } 328 }
317 329
318 return false; 330 return alreadyExisted;
319 } 331 }
320 332
321 /// <summary> 333 /// <summary>
@@ -525,7 +537,10 @@ namespace OpenSim.Region.Framework.Scenes
525 itemID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true, 537 itemID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true,
526 false, false, remoteClient.AgentId, true); 538 false, false, remoteClient.AgentId, true);
527 539
528 540// m_log.DebugFormat(
541// "[SCENE GRAPH]: Retrieved single object {0} for attachment to {1} on point {2}",
542// objatt.Name, remoteClient.Name, AttachmentPt);
543
529 if (objatt != null) 544 if (objatt != null)
530 { 545 {
531 bool tainted = false; 546 bool tainted = false;
@@ -533,7 +548,7 @@ namespace OpenSim.Region.Framework.Scenes
533 tainted = true; 548 tainted = true;
534 549
535 AttachObject(remoteClient, objatt.LocalId, AttachmentPt, Quaternion.Identity, objatt.AbsolutePosition, false); 550 AttachObject(remoteClient, objatt.LocalId, AttachmentPt, Quaternion.Identity, objatt.AbsolutePosition, false);
536 objatt.ScheduleGroupForFullUpdate(); 551 //objatt.ScheduleGroupForFullUpdate();
537 if (tainted) 552 if (tainted)
538 objatt.HasGroupChanged = true; 553 objatt.HasGroupChanged = true;
539 554
@@ -544,8 +559,16 @@ namespace OpenSim.Region.Framework.Scenes
544 // Do this last so that event listeners have access to all the effects of the attachment 559 // Do this last so that event listeners have access to all the effects of the attachment
545 m_parentScene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId); 560 m_parentScene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, remoteClient.AgentId);
546 } 561 }
562 else
563 {
564 m_log.WarnFormat(
565 "[SCENE GRAPH]: Could not retrieve item {0} for attaching to avatar {1} at point {2}",
566 itemID, remoteClient.Name, AttachmentPt);
567 }
568
547 return objatt; 569 return objatt;
548 } 570 }
571
549 return null; 572 return null;
550 } 573 }
551 574
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index c5a6171..c14b39a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -567,8 +567,10 @@ namespace OpenSim.Region.Framework.Scenes
567 } 567 }
568 568
569 ApplyPhysics(m_scene.m_physicalPrim); 569 ApplyPhysics(m_scene.m_physicalPrim);
570 570
571 ScheduleGroupForFullUpdate(); 571 // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
572 // for the same object with very different properties. The caller must schedule the update.
573 //ScheduleGroupForFullUpdate();
572 } 574 }
573 575
574 public Vector3 GroupScale() 576 public Vector3 GroupScale()
@@ -956,10 +958,11 @@ namespace OpenSim.Region.Framework.Scenes
956 // don't attach attachments to child agents 958 // don't attach attachments to child agents
957 if (avatar.IsChildAgent) return; 959 if (avatar.IsChildAgent) return;
958 960
961// m_log.DebugFormat("[SOG]: Adding attachment {0} to avatar {1}", Name, avatar.Name);
962
959 DetachFromBackup(); 963 DetachFromBackup();
960 964
961 // Remove from database and parcel prim count 965 // Remove from database and parcel prim count
962 //
963 m_scene.DeleteFromStorage(UUID); 966 m_scene.DeleteFromStorage(UUID);
964 m_scene.EventManager.TriggerParcelPrimCountTainted(); 967 m_scene.EventManager.TriggerParcelPrimCountTainted();
965 968
@@ -985,7 +988,6 @@ namespace OpenSim.Region.Framework.Scenes
985 SetAttachmentPoint(Convert.ToByte(attachmentpoint)); 988 SetAttachmentPoint(Convert.ToByte(attachmentpoint));
986 989
987 avatar.AddAttachment(this); 990 avatar.AddAttachment(this);
988 m_log.Debug("[SOG]: Added attachment " + UUID + " to avatar " + avatar.UUID);
989 991
990 if (!silent) 992 if (!silent)
991 { 993 {
@@ -1002,6 +1004,12 @@ namespace OpenSim.Region.Framework.Scenes
1002 ScheduleGroupForFullUpdate(); 1004 ScheduleGroupForFullUpdate();
1003 } 1005 }
1004 } 1006 }
1007 else
1008 {
1009 m_log.WarnFormat(
1010 "[SOG]: Tried to add attachment {0} to avatar with UUID {1} in region {2} but the avatar is not present",
1011 UUID, agentID, Scene.RegionInfo.RegionName);
1012 }
1005 } 1013 }
1006 1014
1007 public byte GetAttachmentPoint() 1015 public byte GetAttachmentPoint()
@@ -1986,6 +1994,8 @@ namespace OpenSim.Region.Framework.Scenes
1986 1994
1987 public void ScheduleFullUpdateToAvatar(ScenePresence presence) 1995 public void ScheduleFullUpdateToAvatar(ScenePresence presence)
1988 { 1996 {
1997// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
1998
1989 RootPart.AddFullUpdateToAvatar(presence); 1999 RootPart.AddFullUpdateToAvatar(presence);
1990 2000
1991 lock (m_parts) 2001 lock (m_parts)
@@ -2000,6 +2010,8 @@ namespace OpenSim.Region.Framework.Scenes
2000 2010
2001 public void ScheduleTerseUpdateToAvatar(ScenePresence presence) 2011 public void ScheduleTerseUpdateToAvatar(ScenePresence presence)
2002 { 2012 {
2013// m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1} just to avatar {2}", Name, UUID, presence.Name);
2014
2003 lock (m_parts) 2015 lock (m_parts)
2004 { 2016 {
2005 foreach (SceneObjectPart part in m_parts.Values) 2017 foreach (SceneObjectPart part in m_parts.Values)
@@ -2014,6 +2026,8 @@ namespace OpenSim.Region.Framework.Scenes
2014 /// </summary> 2026 /// </summary>
2015 public void ScheduleGroupForFullUpdate() 2027 public void ScheduleGroupForFullUpdate()
2016 { 2028 {
2029// m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, UUID);
2030
2017 checkAtTargets(); 2031 checkAtTargets();
2018 RootPart.ScheduleFullUpdate(); 2032 RootPart.ScheduleFullUpdate();
2019 2033
@@ -2032,6 +2046,8 @@ namespace OpenSim.Region.Framework.Scenes
2032 /// </summary> 2046 /// </summary>
2033 public void ScheduleGroupForTerseUpdate() 2047 public void ScheduleGroupForTerseUpdate()
2034 { 2048 {
2049// m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID);
2050
2035 lock (m_parts) 2051 lock (m_parts)
2036 { 2052 {
2037 foreach (SceneObjectPart part in m_parts.Values) 2053 foreach (SceneObjectPart part in m_parts.Values)
@@ -2045,9 +2061,11 @@ namespace OpenSim.Region.Framework.Scenes
2045 /// Immediately send a full update for this scene object. 2061 /// Immediately send a full update for this scene object.
2046 /// </summary> 2062 /// </summary>
2047 public void SendGroupFullUpdate() 2063 public void SendGroupFullUpdate()
2048 { 2064 {
2049 if (IsDeleted) 2065 if (IsDeleted)
2050 return; 2066 return;
2067
2068// m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID);
2051 2069
2052 RootPart.SendFullUpdateToAllClients(); 2070 RootPart.SendFullUpdateToAllClients();
2053 2071
@@ -2064,7 +2082,7 @@ namespace OpenSim.Region.Framework.Scenes
2064 /// <summary> 2082 /// <summary>
2065 /// Immediately send an update for this scene object's root prim only. 2083 /// Immediately send an update for this scene object's root prim only.
2066 /// This is for updates regarding the object as a whole, and none of its parts in particular. 2084 /// This is for updates regarding the object as a whole, and none of its parts in particular.
2067 /// Note: this may not be cused by opensim (it probably should) but it's used by 2085 /// Note: this may not be used by opensim (it probably should) but it's used by
2068 /// external modules. 2086 /// external modules.
2069 /// </summary> 2087 /// </summary>
2070 public void SendGroupRootTerseUpdate() 2088 public void SendGroupRootTerseUpdate()
@@ -2079,6 +2097,7 @@ namespace OpenSim.Region.Framework.Scenes
2079 { 2097 {
2080 if (m_scene == null) // Need to check here as it's null during object creation 2098 if (m_scene == null) // Need to check here as it's null during object creation
2081 return; 2099 return;
2100
2082 m_scene.SceneGraph.AddToUpdateList(this); 2101 m_scene.SceneGraph.AddToUpdateList(this);
2083 } 2102 }
2084 2103
@@ -3557,7 +3576,9 @@ namespace OpenSim.Region.Framework.Scenes
3557 HasGroupChanged = true; 3576 HasGroupChanged = true;
3558 } 3577 }
3559 3578
3560 ScheduleGroupForFullUpdate(); 3579 // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
3580 // for the same object with very different properties. The caller must schedule the update.
3581 //ScheduleGroupForFullUpdate();
3561 } 3582 }
3562 3583
3563 public void TriggerScriptChangedEvent(Changed val) 3584 public void TriggerScriptChangedEvent(Changed val)