diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index f52f35bc9e..0ab9374789 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs @@ -379,18 +379,32 @@ namespace OpenSim.Region.Communications.Local public List RequestNamedRegions (string name, int maxNumber) { + List lowercase_regions = new List(); List regions = new List(); 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; } - } }