From e3308c0fa520df50bafb3384b0fd2c7be20bca26 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sat, 30 Aug 2008 01:21:18 +0000 Subject: Mantis#2084. Thank you kindly, HomerHorwitz for a patch that: Addresses the problem of ghost avatars. The problem was child-agents sending data. Due to symmetry reasons, I considered that wrong. Whenever an avatar A1 in region R1 looks at avatar A2 in adjacent region R2, we have two possibilities to communicate: A2-root sends to A1-child (both in region R2), or A2-child sends to A1-root (both in region R1). Currently, the children send data in some cases, and I guess the viewer gets puzzled about that and switches the child to root as consequence (at least partly), so it becomes visible. --- OpenSim/Region/Environment/Scenes/ScenePresence.cs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 4b785e9..1694613 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -412,7 +412,12 @@ namespace OpenSim.Region.Environment.Scenes AbsolutePosition = m_controllingClient.StartPos; - TrySetMovementAnimation("STAND"); + TrySetMovementAnimation("STAND"); // TODO: I think, this won't send anything, as we are still a child here... + + // we created a new ScenePresence (a new child agent) in a fresh region. + // Request info about all the (root) agents in this region + // Note: This won't send data *to* other clients in that region (children don't send) + SendInitialFullUpdateToAllClients(); RegisterToEvents(); SetDirectionVectors(); @@ -1674,11 +1679,15 @@ namespace OpenSim.Region.Environment.Scenes List avatars = m_scene.GetScenePresences(); foreach (ScenePresence avatar in avatars) { - SendFullUpdateToOtherClient(avatar); + // only send if this is the root (children are only "listening posts" in a foreign region) + if (!IsChildAgent) + { + SendFullUpdateToOtherClient(avatar); + } if (avatar.LocalId != LocalId) { - if (!avatar.m_isChildAgent || m_scene.m_seeIntoRegionFromNeighbor) + if (!avatar.IsChildAgent) { avatar.SendFullUpdateToOtherClient(this); avatar.SendAppearanceToOtherAgent(this); @@ -1694,7 +1703,8 @@ namespace OpenSim.Region.Environment.Scenes { m_perfMonMS = System.Environment.TickCount; - List avatars = m_scene.GetScenePresences(); + // only send update from root agents to other clients; children are only "listening posts" + List avatars = m_scene.GetAvatars(); foreach (ScenePresence avatar in avatars) { SendFullUpdateToOtherClient(avatar); @@ -2008,9 +2018,13 @@ namespace OpenSim.Region.Environment.Scenes m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, capsPath); MakeChildAgent(); + // now we have a child agent in this region. Request all interesting data about other (root) agents + SendInitialFullUpdateToAllClients(); + CrossAttachmentsIntoNewRegion(neighbourHandle); m_scene.SendKillObject(m_localId); + m_scene.NotifyMyCoarseLocationChange(); // the user may change their profile information in other region, // so the userinfo in UserProfileCache is not reliable any more, delete it -- cgit v1.1