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.
0.6.0-stable
Charles Krinke 2008-08-30 01:21:18 +00:00
parent fda5457996
commit e3308c0fa5
1 changed files with 18 additions and 4 deletions

View File

@ -412,7 +412,12 @@ namespace OpenSim.Region.Environment.Scenes
AbsolutePosition = m_controllingClient.StartPos; 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(); RegisterToEvents();
SetDirectionVectors(); SetDirectionVectors();
@ -1673,12 +1678,16 @@ namespace OpenSim.Region.Environment.Scenes
List<ScenePresence> avatars = m_scene.GetScenePresences(); List<ScenePresence> avatars = m_scene.GetScenePresences();
foreach (ScenePresence avatar in avatars) foreach (ScenePresence avatar in avatars)
{
// only send if this is the root (children are only "listening posts" in a foreign region)
if (!IsChildAgent)
{ {
SendFullUpdateToOtherClient(avatar); SendFullUpdateToOtherClient(avatar);
}
if (avatar.LocalId != LocalId) if (avatar.LocalId != LocalId)
{ {
if (!avatar.m_isChildAgent || m_scene.m_seeIntoRegionFromNeighbor) if (!avatar.IsChildAgent)
{ {
avatar.SendFullUpdateToOtherClient(this); avatar.SendFullUpdateToOtherClient(this);
avatar.SendAppearanceToOtherAgent(this); avatar.SendAppearanceToOtherAgent(this);
@ -1694,7 +1703,8 @@ namespace OpenSim.Region.Environment.Scenes
{ {
m_perfMonMS = System.Environment.TickCount; m_perfMonMS = System.Environment.TickCount;
List<ScenePresence> avatars = m_scene.GetScenePresences(); // only send update from root agents to other clients; children are only "listening posts"
List<ScenePresence> avatars = m_scene.GetAvatars();
foreach (ScenePresence avatar in avatars) foreach (ScenePresence avatar in avatars)
{ {
SendFullUpdateToOtherClient(avatar); SendFullUpdateToOtherClient(avatar);
@ -2008,9 +2018,13 @@ namespace OpenSim.Region.Environment.Scenes
m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint,
capsPath); capsPath);
MakeChildAgent(); MakeChildAgent();
// now we have a child agent in this region. Request all interesting data about other (root) agents
SendInitialFullUpdateToAllClients();
CrossAttachmentsIntoNewRegion(neighbourHandle); CrossAttachmentsIntoNewRegion(neighbourHandle);
m_scene.SendKillObject(m_localId); m_scene.SendKillObject(m_localId);
m_scene.NotifyMyCoarseLocationChange(); m_scene.NotifyMyCoarseLocationChange();
// the user may change their profile information in other region, // the user may change their profile information in other region,
// so the userinfo in UserProfileCache is not reliable any more, delete it // so the userinfo in UserProfileCache is not reliable any more, delete it