From beef41f24cfdc57e584d19beed423cba83b7f829 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 14 Jan 2015 19:40:17 +0000 Subject: Stop simulators attempting to contact registered but offline regions (RegionFlags.Persistent but not RegioNFlags.RegionOnline) on startup and when an avatar completes a teleport. This eliminates spurious network calls and failure reporting. This is done by adding RegionFlags to the GridRegion returned data in a backward compatible way as an alternative to multiple IGridService.GetRegionFlags() calls Using a simulator or a grid service older than this commit will just see previous behaviour. --- .../Framework/Scenes/SceneCommunicationService.cs | 27 +++++++++++++++++++++- 1 file changed, 26 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 9db5309..8101768 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -109,10 +109,35 @@ namespace OpenSim.Region.Framework.Scenes List neighbours = m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID); - m_log.DebugFormat("{0} Informing {1} neighbours that region {2} is up", LogHeader, neighbours.Count, m_scene.Name); + List onlineNeighbours = new List(); foreach (GridRegion n in neighbours) { + OpenSim.Framework.RegionFlags? regionFlags = n.RegionFlags; + +// m_log.DebugFormat( +// "{0}: Region flags for {1} as seen by {2} are {3}", +// LogHeader, n.RegionName, m_scene.Name, regionFlags != null ? regionFlags.ToString() : "not present"); + + // Robust services before 2015-01-14 do not return the regionFlags information. In this case, we could + // make a separate RegionFlags call but this would involve a network call for each neighbour. + if (regionFlags != null) + { + if ((regionFlags & OpenSim.Framework.RegionFlags.RegionOnline) != 0) + onlineNeighbours.Add(n); + } + else + { + onlineNeighbours.Add(n); + } + } + + m_log.DebugFormat( + "{0} Informing {1} neighbours that region {2} is up", + LogHeader, onlineNeighbours.Count, m_scene.Name); + + foreach (GridRegion n in onlineNeighbours) + { InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; d.BeginInvoke(neighbourService, region, n.RegionHandle, InformNeighborsThatRegionisUpCompleted, -- cgit v1.1