From c4edefd9a0982e5b9c205a39c858d50abc677240 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sun, 6 Sep 2009 21:26:59 -0400 Subject: minor: organizational * Move the neighbor region lookup to another method from where it was before in EnableNeighbourChildAgents. --- .../Framework/Scenes/SceneCommunicationService.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index c6b3f30..08563d0 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -407,6 +407,24 @@ namespace OpenSim.Region.Framework.Scenes //blah.Port = region.RemotingPort; } + public List RequestNeighbors(Scene pScene, uint pRegionLocX, uint pRegionLocY) + { + Border[] northBorders = pScene.NorthBorders.ToArray(); + Border[] southBorders = pScene.SouthBorders.ToArray(); + Border[] eastBorders = pScene.EastBorders.ToArray(); + Border[] westBorders = pScene.WestBorders.ToArray(); + + // Legacy one region. Provided for simplicity while testing the all inclusive method in the else statement. + if (northBorders.Length <= 1 && southBorders.Length <= 1 && eastBorders.Length <= 1 && westBorders.Length <= 1) + { + return m_commsProvider.GridService.RequestNeighbours(pRegionLocX, pRegionLocY); + } + else + { + return m_commsProvider.GridService.RequestNeighbours(pRegionLocX, pRegionLocY); + } + } + /// /// This informs all neighboring regions about agent "avatar". /// Calls an asynchronous method to do so.. so it doesn't lag the sim. @@ -429,7 +447,7 @@ namespace OpenSim.Region.Framework.Scenes if (m_regionInfo != null) { neighbours = - m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); + RequestNeighbors(avatar.Scene,m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); } else { -- cgit v1.1