From 0e6f57a3038e54cb1a2f229ebaae0cf8ee05b7ea Mon Sep 17 00:00:00 2001
From: MW
Date: Tue, 21 Aug 2007 18:11:45 +0000
Subject: Hopefully fixed the problem of users avatars not always showing up
 when either you or another user has crossed from one region to another.
 (however a avatar's appearance isn't kept across regions, but we need to add
 that to inter-regions communications so for now people will have to put up
 with some other user's avatars appearing as the bald(ish) fat man

---
 OpenSim/Region/Environment/Scenes/Scene.cs         |  9 +++++++++
 OpenSim/Region/Environment/Scenes/ScenePresence.cs | 16 ++++++++++------
 2 files changed, 19 insertions(+), 6 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index f674ce2..cdf6788 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -883,6 +883,15 @@ namespace OpenSim.Region.Environment.Scenes
             return false;
         }
 
+        public void SendKillObject(uint localID)
+        {
+            List<ScenePresence> avatars = this.RequestAvatarList();
+            for (int i = 0; i < avatars.Count; i++)
+            {
+                avatars[i].ControllingClient.SendKillObject(this.m_regionHandle, localID);
+            }
+        }
+
         public void SendAllSceneObjectsToClient(IClientAPI client)
         {
             foreach (EntityBase ent in Entities.Values)
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 73e9d48..47f991c 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -461,8 +461,11 @@ namespace OpenSim.Region.Environment.Scenes
                 this.SendFullUpdateToOtherClient(avatar);
                 if (avatar.LocalId != this.LocalId)
                 {
-                    avatar.SendFullUpdateToOtherClient(this);
-                    avatar.SendAppearanceToOtherAgent(this);
+                    if (!avatar.childAgent)
+                    {
+                        avatar.SendFullUpdateToOtherClient(this);
+                        avatar.SendAppearanceToOtherAgent(this);
+                    }
                 }
             }
         }
@@ -479,8 +482,8 @@ namespace OpenSim.Region.Environment.Scenes
                 this.newAvatar = false;
             }
 
-            // this.SendFullUpdateToALLClients();
-            //  this.SendArrearanceToAllOtherAgents();
+             this.SendFullUpdateToALLClients();
+             this.SendArrearanceToAllOtherAgents();
         }
 
         /// <summary>
@@ -491,8 +494,8 @@ namespace OpenSim.Region.Environment.Scenes
         {
             this.ControllingClient.SendWearables(this.Wearables);
 
-            this.SendFullUpdateToALLClients();
-            this.SendArrearanceToAllOtherAgents();
+            //this.SendFullUpdateToALLClients();
+            //this.SendArrearanceToAllOtherAgents();
 
             this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient);
             this.ControllingClient.SendViewerTime(this.m_scene.TimePhase);
@@ -638,6 +641,7 @@ namespace OpenSim.Region.Environment.Scenes
                     string capsPath = Util.GetCapsURL(this.ControllingClient.AgentId);
                     this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, capsPath);
                     this.MakeChildAgent();
+                    this.m_scene.SendKillObject(this.m_localId);
                 }
             }
         }
-- 
cgit v1.1