diff options
Diffstat (limited to 'OpenSim/Region/Communications/Local')
-rw-r--r-- | OpenSim/Region/Communications/Local/LocalBackEndServices.cs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index f52f35b..0ab9374 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs | |||
@@ -379,18 +379,32 @@ namespace OpenSim.Region.Communications.Local | |||
379 | 379 | ||
380 | public List<RegionInfo> RequestNamedRegions (string name, int maxNumber) | 380 | public List<RegionInfo> RequestNamedRegions (string name, int maxNumber) |
381 | { | 381 | { |
382 | List<RegionInfo> lowercase_regions = new List<RegionInfo>(); | ||
382 | List<RegionInfo> regions = new List<RegionInfo>(); | 383 | List<RegionInfo> regions = new List<RegionInfo>(); |
383 | foreach (RegionInfo info in m_regions.Values) | 384 | foreach (RegionInfo info in m_regions.Values) |
384 | { | 385 | { |
386 | // Prioritizes exact match | ||
385 | if (info.RegionName.StartsWith(name)) | 387 | if (info.RegionName.StartsWith(name)) |
386 | { | 388 | { |
387 | regions.Add(info); | 389 | regions.Add(info); |
388 | if (regions.Count >= maxNumber) break; | 390 | if (regions.Count >= maxNumber) break; |
389 | } | 391 | } |
392 | // But still saves lower case matches | ||
393 | else if (info.RegionName.ToLower().StartsWith(name)) | ||
394 | { | ||
395 | if (lowercase_regions.Count < maxNumber) | ||
396 | { | ||
397 | lowercase_regions.Add(info); | ||
398 | } | ||
399 | } | ||
390 | } | 400 | } |
391 | 401 | ||
402 | // If no exact matches found, return lowercase matches (libOMV compatiblity) | ||
403 | if (regions.Count == 0 && lowercase_regions.Count != 0) | ||
404 | { | ||
405 | return lowercase_regions; | ||
406 | } | ||
392 | return regions; | 407 | return regions; |
393 | } | 408 | } |
394 | |||
395 | } | 409 | } |
396 | } | 410 | } |