mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
do not consider a hyperlink a fallback region
This commit is contained in:
@@ -790,17 +790,21 @@ namespace OpenSim.Services.GridService
|
||||
List<GridRegion> ret = new List<GridRegion>();
|
||||
|
||||
List<RegionData> regions = m_Database.GetFallbackRegions(scopeID);
|
||||
if(regions.Count > 0)
|
||||
{
|
||||
if (regions.Count > 1)
|
||||
{
|
||||
regions.Sort(new RegionDataDistanceCompare(x, y));
|
||||
}
|
||||
|
||||
if(regions.Count > 1)
|
||||
{
|
||||
RegionDataDistanceCompare distanceComparer = new RegionDataDistanceCompare(x, y);
|
||||
regions.Sort(distanceComparer);
|
||||
}
|
||||
|
||||
foreach (RegionData r in regions)
|
||||
{
|
||||
if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Framework.RegionFlags.RegionOnline) != 0)
|
||||
ret.Add(RegionData2RegionInfo(r));
|
||||
foreach (RegionData r in regions)
|
||||
{
|
||||
int rflags = Convert.ToInt32(r.Data["flags"]);
|
||||
if((rflags & (int)OpenSim.Framework.RegionFlags.Hyperlink) != 0)
|
||||
continue;
|
||||
if ((rflags & (int)OpenSim.Framework.RegionFlags.RegionOnline) != 0)
|
||||
ret.Add(RegionData2RegionInfo(r));
|
||||
}
|
||||
}
|
||||
|
||||
m_log.DebugFormat("[GRID SERVICE]: Fallback returned {0} regions", ret.Count);
|
||||
|
||||
@@ -804,11 +804,9 @@ namespace OpenSim.Services.LLLoginService
|
||||
List<GridRegion> regions = m_GridService.GetFallbackRegions(scopeID, (int)Util.RegionToWorldLoc(1000), (int)Util.RegionToWorldLoc(1000));
|
||||
if (regions != null && regions.Count > 0)
|
||||
{
|
||||
hyperlinks = m_GridService.GetHyperlinks(scopeID);
|
||||
IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks);
|
||||
if (availableRegions.Count() > 0)
|
||||
return availableRegions.ElementAt(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);
|
||||
|
||||
Reference in New Issue
Block a user