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/Region/Framework/Scenes/SceneCommunicationService.cs') 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 From 326c3ee14fb294796ff3b908f17da1021d321e3b Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Mon, 7 Sep 2009 12:57:30 -0400 Subject: * Enables Child Agents for all virtual regions in the region and their neighbors. There still may be issues with crossing into the mentioned neighbors of the virtual regions. This makes regions larger then 512x512 (3 virtual regions) display fully to clients. * Uses a grid request multiple times, so the more regions are in the instance, the longer logging in takes. Consider this temporary until there's a RegionInfo request similar to the MapItem Request. --- .../Framework/Scenes/SceneCommunicationService.cs | 58 +++++++++++++++++++++- 1 file changed, 56 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs') diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 08563d0..0827672 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -367,6 +367,7 @@ namespace OpenSim.Region.Framework.Scenes string reason = String.Empty; //bool regionAccepted = m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, a); + bool regionAccepted = m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, a, out reason); if (regionAccepted && newAgent) @@ -384,7 +385,7 @@ namespace OpenSim.Region.Framework.Scenes eq.EnableSimulator(reg.RegionHandle, endPoint, avatar.UUID); eq.EstablishAgentCommunication(avatar.UUID, endPoint, capsPath); - m_log.DebugFormat("[CAPS]: Sending new CAPS seed url {0} to client {1} in region {2}", + m_log.DebugFormat("[CAPS]: Sending new CAPS seed url {0} to client {1} in region {2}", capsPath, avatar.UUID, avatar.Scene.RegionInfo.RegionName); } else @@ -394,7 +395,9 @@ namespace OpenSim.Region.Framework.Scenes } m_log.Info("[INTERGRID]: Completed inform client about neighbour " + endPoint.ToString()); + } + } public void RequestNeighbors(RegionInfo region) @@ -421,7 +424,48 @@ namespace OpenSim.Region.Framework.Scenes } else { - return m_commsProvider.GridService.RequestNeighbours(pRegionLocX, pRegionLocY); + Vector2 extent = Vector2.Zero; + for (int i=0;i extent.X) ? eastBorders[i].BorderLine.Z : extent.X; + } + for (int i=0;i extent.Y) ? northBorders[i].BorderLine.Z : extent.Y; + } + + List neighbourList = new List(); + + // Loss of fraction on purpose + extent.X = ((int)extent.X / (int)Constants.RegionSize) + 1; + extent.Y = ((int)extent.Y / (int)Constants.RegionSize) + 1; + + int startX = (int) pRegionLocX - 1; + int startY = (int) pRegionLocY - 1; + + int endX = (int) pRegionLocX + (int)extent.X + 1; + int endY = (int) pRegionLocY + (int)extent.Y + 1; + + for (int i=startX;i