at login, if target region is not found and there are no default of fallback regions, try to send user to a region online. This is similar to what we had before 0.9.2.0, that demands the definition of default region(s)

This commit is contained in:
UbitUmarov
2021-12-07 01:05:51 +00:00
parent 131455b107
commit 2db2791771

View File

@@ -800,24 +800,14 @@ namespace OpenSim.Services.LLLoginService
private GridRegion FindAlternativeRegion(UUID scopeID)
{
List<GridRegion> hyperlinks = null;
List<GridRegion> regions = m_GridService.GetFallbackRegions(scopeID, (int)Util.RegionToWorldLoc(1000), (int)Util.RegionToWorldLoc(1000));
if (regions != null && regions.Count > 0)
{
return regions[0];
}
// No fallbacks, try to find an arbitrary region that is not a hyperlink
// maxNumber is fixed for now; maybe use some search pattern with increasing maxSize here?
regions = m_GridService.GetRegionsByName(scopeID, "", 10);
regions = m_GridService.GetOnlineRegions(scopeID, (int)Util.RegionToWorldLoc(1000), (int)Util.RegionToWorldLoc(1000), 10);
if (regions != null && regions.Count > 0)
{
if (hyperlinks == null)
hyperlinks = m_GridService.GetHyperlinks(scopeID);
IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks);
if (availableRegions.Count() > 0)
return availableRegions.ElementAt(0);
}
return regions[0];
return null;
}