diff options
author | Charles Krinke | 2008-08-30 01:21:18 +0000 |
---|---|---|
committer | Charles Krinke | 2008-08-30 01:21:18 +0000 |
commit | e3308c0fa520df50bafb3384b0fd2c7be20bca26 (patch) | |
tree | c7ca867a3ef3b287bf4239dfc9681b15ed075e9c | |
parent | Maintis #2078 (diff) | |
download | opensim-SC_OLD-e3308c0fa520df50bafb3384b0fd2c7be20bca26.zip opensim-SC_OLD-e3308c0fa520df50bafb3384b0fd2c7be20bca26.tar.gz opensim-SC_OLD-e3308c0fa520df50bafb3384b0fd2c7be20bca26.tar.bz2 opensim-SC_OLD-e3308c0fa520df50bafb3384b0fd2c7be20bca26.tar.xz |
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.
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 22 |
1 files changed, 18 insertions, 4 deletions
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 | |||
412 | 412 | ||
413 | AbsolutePosition = m_controllingClient.StartPos; | 413 | AbsolutePosition = m_controllingClient.StartPos; |
414 | 414 | ||
415 | TrySetMovementAnimation("STAND"); | 415 | TrySetMovementAnimation("STAND"); // TODO: I think, this won't send anything, as we are still a child here... |
416 | |||
417 | // we created a new ScenePresence (a new child agent) in a fresh region. | ||
418 | // Request info about all the (root) agents in this region | ||
419 | // Note: This won't send data *to* other clients in that region (children don't send) | ||
420 | SendInitialFullUpdateToAllClients(); | ||
416 | 421 | ||
417 | RegisterToEvents(); | 422 | RegisterToEvents(); |
418 | SetDirectionVectors(); | 423 | SetDirectionVectors(); |
@@ -1674,11 +1679,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
1674 | List<ScenePresence> avatars = m_scene.GetScenePresences(); | 1679 | List<ScenePresence> avatars = m_scene.GetScenePresences(); |
1675 | foreach (ScenePresence avatar in avatars) | 1680 | foreach (ScenePresence avatar in avatars) |
1676 | { | 1681 | { |
1677 | SendFullUpdateToOtherClient(avatar); | 1682 | // only send if this is the root (children are only "listening posts" in a foreign region) |
1683 | if (!IsChildAgent) | ||
1684 | { | ||
1685 | SendFullUpdateToOtherClient(avatar); | ||
1686 | } | ||
1678 | 1687 | ||
1679 | if (avatar.LocalId != LocalId) | 1688 | if (avatar.LocalId != LocalId) |
1680 | { | 1689 | { |
1681 | if (!avatar.m_isChildAgent || m_scene.m_seeIntoRegionFromNeighbor) | 1690 | if (!avatar.IsChildAgent) |
1682 | { | 1691 | { |
1683 | avatar.SendFullUpdateToOtherClient(this); | 1692 | avatar.SendFullUpdateToOtherClient(this); |
1684 | avatar.SendAppearanceToOtherAgent(this); | 1693 | avatar.SendAppearanceToOtherAgent(this); |
@@ -1694,7 +1703,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1694 | { | 1703 | { |
1695 | m_perfMonMS = System.Environment.TickCount; | 1704 | m_perfMonMS = System.Environment.TickCount; |
1696 | 1705 | ||
1697 | List<ScenePresence> avatars = m_scene.GetScenePresences(); | 1706 | // only send update from root agents to other clients; children are only "listening posts" |
1707 | List<ScenePresence> avatars = m_scene.GetAvatars(); | ||
1698 | foreach (ScenePresence avatar in avatars) | 1708 | foreach (ScenePresence avatar in avatars) |
1699 | { | 1709 | { |
1700 | SendFullUpdateToOtherClient(avatar); | 1710 | SendFullUpdateToOtherClient(avatar); |
@@ -2008,9 +2018,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
2008 | m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, | 2018 | m_controllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint, |
2009 | capsPath); | 2019 | capsPath); |
2010 | MakeChildAgent(); | 2020 | MakeChildAgent(); |
2021 | // now we have a child agent in this region. Request all interesting data about other (root) agents | ||
2022 | SendInitialFullUpdateToAllClients(); | ||
2023 | |||
2011 | CrossAttachmentsIntoNewRegion(neighbourHandle); | 2024 | CrossAttachmentsIntoNewRegion(neighbourHandle); |
2012 | 2025 | ||
2013 | m_scene.SendKillObject(m_localId); | 2026 | m_scene.SendKillObject(m_localId); |
2027 | |||
2014 | m_scene.NotifyMyCoarseLocationChange(); | 2028 | m_scene.NotifyMyCoarseLocationChange(); |
2015 | // the user may change their profile information in other region, | 2029 | // the user may change their profile information in other region, |
2016 | // so the userinfo in UserProfileCache is not reliable any more, delete it | 2030 | // so the userinfo in UserProfileCache is not reliable any more, delete it |