From ae00623b6567eb328eb6249bf2f2f9ad08175844 Mon Sep 17 00:00:00 2001
From: UbitUmarov
Date: Mon, 31 Dec 2018 13:33:00 +0000
Subject: lost in updates

---
 .../Region/Framework/Scenes/SceneObjectGroup.cs    | 76 ++++++++++++----------
 1 file changed, 41 insertions(+), 35 deletions(-)

(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')

diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 080faeb..8274136 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -950,7 +950,7 @@ namespace OpenSim.Region.Framework.Scenes
 
                 sog.inTransit = false;
                 AttachToBackup();
-                sog.ScheduleGroupForFullUpdate();
+                sog.ScheduleGroupForFullAnimUpdate();
             }
         }
 
@@ -2668,7 +2668,7 @@ namespace OpenSim.Region.Framework.Scenes
                 dupe.HasGroupChanged = true;
                 dupe.AttachToBackup();
 
-                dupe.ScheduleGroupForFullUpdate();
+                dupe.ScheduleGroupForFullAnimUpdate();
             }
 
             dupe.InvalidatePartsLinkMaps();
@@ -3028,10 +3028,12 @@ namespace OpenSim.Region.Framework.Scenes
         /// </remarks>
         public void ScheduleGroupForFullUpdate()
         {
-//            if (IsAttachment)
-//                m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId);
-
+            //            if (IsAttachment)
+            //                m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId);
             checkAtTargets();
+            if (Scene.GetNumberOfClients() == 0)
+                return;
+
             RootPart.ScheduleFullUpdate();
 
             SceneObjectPart[] parts = m_parts.GetArray();
@@ -3043,54 +3045,58 @@ namespace OpenSim.Region.Framework.Scenes
             }
         }
 
-        /// <summary>
-        /// Schedule a terse update for this scene object to all interested viewers.
-        /// </summary>
-        /// <remarks>
-        /// Ultimately, this should be managed such that region modules can invoke it at the end of a set of operations
-        /// so that either all changes are sent at once.  However, currently, a large amount of internal
-        /// code will set this anyway when some object properties are changed.
-        /// </remarks>
-        public void ScheduleGroupForTerseUpdate()
+        public void ScheduleGroupForFullAnimUpdate()
         {
-//            m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID);
-
-            SceneObjectPart[] parts = m_parts.GetArray();
-            for (int i = 0; i < parts.Length; i++)
-                parts[i].ScheduleTerseUpdate();
-        }
+            //            if (IsAttachment)
+            //                m_log.DebugFormat("[SOG]: Scheduling full update for {0} {1}", Name, LocalId);
+            checkAtTargets();
 
-        /// <summary>
-        /// Immediately send a full update for this scene object.
-        /// </summary>
-        public void SendGroupFullUpdate()
-        {
-            if (IsDeleted)
+            if (Scene.GetNumberOfClients() == 0)
                 return;
 
-//            m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID);
+            SceneObjectPart[] parts = m_parts.GetArray();
 
-            if (IsAttachment)
+            if (!RootPart.Shape.MeshFlagEntry)
             {
-                ScenePresence sp = m_scene.GetScenePresence(AttachedAvatar);
-                if (sp != null)
+                RootPart.ScheduleFullUpdate();
+
+                for (int i = 0; i < parts.Length; i++)
                 {
-                    sp.SendAttachmentUpdate(this, PrimUpdateFlags.FullUpdate);
-                    return;
+                    SceneObjectPart part = parts[i];
+                    if (part != RootPart)
+                        part.ScheduleFullUpdate();
                 }
+                return;
             }
 
-            RootPart.SendFullUpdateToAllClientsNoAttachment();
-            SceneObjectPart[] parts = m_parts.GetArray();
+            RootPart.ScheduleFullAnimUpdate();
+
             for (int i = 0; i < parts.Length; i++)
             {
                 SceneObjectPart part = parts[i];
                 if (part != RootPart)
-                    part.SendFullUpdateToAllClientsNoAttachment();
+                    part.ScheduleFullAnimUpdate();
             }
         }
 
         /// <summary>
+        /// Schedule a terse update for this scene object to all interested viewers.
+        /// </summary>
+        /// <remarks>
+        /// Ultimately, this should be managed such that region modules can invoke it at the end of a set of operations
+        /// so that either all changes are sent at once.  However, currently, a large amount of internal
+        /// code will set this anyway when some object properties are changed.
+        /// </remarks>
+        public void ScheduleGroupForTerseUpdate()
+        {
+//            m_log.DebugFormat("[SOG]: Scheduling terse update for {0} {1}", Name, UUID);
+
+            SceneObjectPart[] parts = m_parts.GetArray();
+            for (int i = 0; i < parts.Length; i++)
+                parts[i].ScheduleTerseUpdate();
+        }
+
+        /// <summary>
         /// Immediately send an update for this scene object's root prim only.
         /// This is for updates regarding the object as a whole, and none of its parts in particular.
         /// Note: this may not be used by opensim (it probably should) but it's used by
-- 
cgit v1.1