* Allow for lowercase searching in standalone mode, when case sensitive
search fails. This allows compability to libOMV bots, that always lowercase region names. * Uncertain if this should/could propagate to grids0.6.6-post-fixes
parent
8e011ecbbb
commit
63a499c569
|
@ -379,18 +379,32 @@ namespace OpenSim.Region.Communications.Local
|
|||
|
||||
public List<RegionInfo> RequestNamedRegions (string name, int maxNumber)
|
||||
{
|
||||
List<RegionInfo> lowercase_regions = new List<RegionInfo>();
|
||||
List<RegionInfo> regions = new List<RegionInfo>();
|
||||
foreach (RegionInfo info in m_regions.Values)
|
||||
{
|
||||
// Prioritizes exact match
|
||||
if (info.RegionName.StartsWith(name))
|
||||
{
|
||||
regions.Add(info);
|
||||
if (regions.Count >= maxNumber) break;
|
||||
}
|
||||
// But still saves lower case matches
|
||||
else if (info.RegionName.ToLower().StartsWith(name))
|
||||
{
|
||||
if (lowercase_regions.Count < maxNumber)
|
||||
{
|
||||
lowercase_regions.Add(info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If no exact matches found, return lowercase matches (libOMV compatiblity)
|
||||
if (regions.Count == 0 && lowercase_regions.Count != 0)
|
||||
{
|
||||
return lowercase_regions;
|
||||
}
|
||||
return regions;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue