aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs19
1 files changed, 4 insertions, 15 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index c36c5ba..2b638e3 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -675,7 +675,7 @@ namespace OpenSim.Region.Environment.Scenes
675 675
676 // the avatar.Close below will clear the child region list. We need this below for (possibly) 676 // the avatar.Close below will clear the child region list. We need this below for (possibly)
677 // closing the child agents, so save it here (we need a copy as it is Clear()-ed). 677 // closing the child agents, so save it here (we need a copy as it is Clear()-ed).
678 //List<ulong> childRegions = new List<ulong>(avatar.GetKnownRegionList()); 678 List<ulong> childRegions = new List<ulong>(avatar.GetKnownRegionList());
679 // Compared to ScenePresence.CrossToNewRegion(), there's no obvious code to handle a teleport 679 // Compared to ScenePresence.CrossToNewRegion(), there's no obvious code to handle a teleport
680 // failure at this point (unlike a border crossing failure). So perhaps this can never fail 680 // failure at this point (unlike a border crossing failure). So perhaps this can never fail
681 // once we reach here... 681 // once we reach here...
@@ -727,28 +727,17 @@ namespace OpenSim.Region.Environment.Scenes
727 KiPrimitive(avatar.LocalId); 727 KiPrimitive(avatar.LocalId);
728 } 728 }
729 729
730 avatar.Close();
730 731
731 uint newRegionX = (uint)(reg.RegionHandle >> 40); 732 uint newRegionX = (uint)(reg.RegionHandle >> 40);
732 uint newRegionY = (((uint)(reg.RegionHandle)) >> 8); 733 uint newRegionY = (((uint)(reg.RegionHandle)) >> 8);
733 uint oldRegionX = (uint)(m_regionInfo.RegionHandle >> 40); 734 uint oldRegionX = (uint)(m_regionInfo.RegionHandle >> 40);
734 uint oldRegionY = (((uint)(m_regionInfo.RegionHandle)) >> 8); 735 uint oldRegionY = (((uint)(m_regionInfo.RegionHandle)) >> 8);
735 736
736 // Let's close some children agents 737 if (Util.fast_distance2d((int)(newRegionX - oldRegionX), (int)(newRegionY - oldRegionY)) > 3)
737 avatar.CloseChildAgents(newRegionX, newRegionY);
738
739 avatar.Close();
740
741 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
742
743 // This is a little too fast of a distance computation... it's not consistent with the rule
744 // of having child agents in exactly the adjacent regions. Some topologies result in orphan
745 // children
746 //if (Util.fast_distance2d((int)(newRegionX - oldRegionX), (int)(newRegionY - oldRegionY)) > 3)
747 //if (((int)Math.Abs((int)(newRegionX - oldRegionX)) > 1) || ((int)Math.Abs((int)(newRegionY - oldRegionY)) > 1))
748 if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY))
749 { 738 {
750 //SendCloseChildAgentConnections(avatar.UUID,avatar.GetKnownRegionList()); 739 //SendCloseChildAgentConnections(avatar.UUID,avatar.GetKnownRegionList());
751 //SendCloseChildAgentConnections(avatar.UUID, childRegions); 740 SendCloseChildAgentConnections(avatar.UUID, childRegions);
752 CloseConnection(avatar.UUID); 741 CloseConnection(avatar.UUID);
753 } 742 }
754 743