aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs40
-rw-r--r--prebuild.xml1
2 files changed, 31 insertions, 10 deletions
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index a06476e..fcfdd1d 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Linq;
31using System.Net; 32using System.Net;
32using System.Reflection; 33using System.Reflection;
33using System.Text.RegularExpressions; 34using System.Text.RegularExpressions;
@@ -427,12 +428,9 @@ namespace OpenSim.Services.LLLoginService
427 { 428 {
428 m_log.WarnFormat("[LLOGIN SERVICE]: User {0} {1} does not have a valid home and this grid does not have default locations. Attempting to find random region", 429 m_log.WarnFormat("[LLOGIN SERVICE]: User {0} {1} does not have a valid home and this grid does not have default locations. Attempting to find random region",
429 account.FirstName, account.LastName); 430 account.FirstName, account.LastName);
430 defaults = m_GridService.GetRegionsByName(scopeID, "", 1); 431 region = FindAlternativeRegion(scopeID);
431 if (defaults != null && defaults.Count > 0) 432 if (region != null)
432 {
433 region = defaults[0];
434 where = "safe"; 433 where = "safe";
435 }
436 } 434 }
437 } 435 }
438 436
@@ -459,12 +457,9 @@ namespace OpenSim.Services.LLLoginService
459 else 457 else
460 { 458 {
461 m_log.Info("[LLOGIN SERVICE]: Last Region Not Found Attempting to find random region"); 459 m_log.Info("[LLOGIN SERVICE]: Last Region Not Found Attempting to find random region");
462 defaults = m_GridService.GetRegionsByName(scopeID, "", 1); 460 region = FindAlternativeRegion(scopeID);
463 if (defaults != null && defaults.Count > 0) 461 if (region != null)
464 {
465 region = defaults[0];
466 where = "safe"; 462 where = "safe";
467 }
468 } 463 }
469 464
470 } 465 }
@@ -564,6 +559,31 @@ namespace OpenSim.Services.LLLoginService
564 559
565 } 560 }
566 561
562 private GridRegion FindAlternativeRegion(UUID scopeID)
563 {
564 List<GridRegion> hyperlinks = null;
565 List<GridRegion> regions = m_GridService.GetFallbackRegions(scopeID, 1000 * (int)Constants.RegionSize, 1000 * (int)Constants.RegionSize);
566 if (regions != null && regions.Count > 0)
567 {
568 hyperlinks = m_GridService.GetHyperlinks(scopeID);
569 IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks);
570 if (availableRegions.Count() > 0)
571 return availableRegions.ElementAt(0);
572 }
573 // No fallbacks, try to find an arbitrary region that is not a hyperlink
574 // maxNumber is fixed for now; maybe use some search pattern with increasing maxSize here?
575 regions = m_GridService.GetRegionsByName(scopeID, "", 10);
576 if (regions != null && regions.Count > 0)
577 {
578 if (hyperlinks == null)
579 hyperlinks = m_GridService.GetHyperlinks(scopeID);
580 IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks);
581 if (availableRegions.Count() > 0)
582 return availableRegions.ElementAt(0);
583 }
584 return null;
585 }
586
567 private GridRegion FindForeignRegion(string domainName, uint port, string regionName, out GridRegion gatekeeper) 587 private GridRegion FindForeignRegion(string domainName, uint port, string regionName, out GridRegion gatekeeper)
568 { 588 {
569 gatekeeper = new GridRegion(); 589 gatekeeper = new GridRegion();
diff --git a/prebuild.xml b/prebuild.xml
index e77d5c1..ac003d9 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -1214,6 +1214,7 @@
1214 1214
1215 <ReferencePath>../../../bin/</ReferencePath> 1215 <ReferencePath>../../../bin/</ReferencePath>
1216 <Reference name="System"/> 1216 <Reference name="System"/>
1217 <Reference name="System.Core"/>
1217 <Reference name="OpenSim.Framework"/> 1218 <Reference name="OpenSim.Framework"/>
1218 <Reference name="OpenSim.Framework.Capabilities"/> 1219 <Reference name="OpenSim.Framework.Capabilities"/>
1219 <Reference name="OpenSim.Framework.Console"/> 1220 <Reference name="OpenSim.Framework.Console"/>