Select Random Region if Home or Last cant be found

slimupdates
unknown 2010-03-27 08:16:41 +13:00 committed by Diva Canto
parent dd1c1b3bcd
commit 9fb17e7ab2
1 changed files with 34 additions and 14 deletions

View File

@ -339,9 +339,17 @@ namespace OpenSim.Services.LLLoginService
where = "safe"; where = "safe";
} }
else else
m_log.WarnFormat( {
"[LLOGIN SERVICE]: User {0} {1} does not have a valid home and this grid does not have default locations.", m_log.WarnFormat("[LLOGIN SERVICE]: User {0} {1} does not have a valid home and this grid does not have default locations.",
account.FirstName, account.LastName); account.FirstName, account.LastName);
m_log.Info("[LLOGIN SERVICE]: Home Region Not Found Attempting to find random region");
defaults = m_GridService.GetRegionsByName(account.ScopeID, "", 1);
if (defaults != null && defaults.Count > 0)
{
region = defaults[0];
where = "safe";
}
}
} }
return region; return region;
@ -364,6 +372,17 @@ namespace OpenSim.Services.LLLoginService
region = defaults[0]; region = defaults[0];
where = "safe"; where = "safe";
} }
else
{
m_log.Info("[LLOGIN SERVICE]: Last Region Not Found Attempting to find random region");
defaults = m_GridService.GetRegionsByName(account.ScopeID, "", 1);
if (defaults != null && defaults.Count > 0)
{
region = defaults[0];
where = "safe";
}
}
} }
else else
{ {
@ -396,7 +415,6 @@ namespace OpenSim.Services.LLLoginService
{ {
if (!regionName.Contains("@")) if (!regionName.Contains("@"))
{ {
List<GridRegion> regions = m_GridService.GetRegionsByName(account.ScopeID, regionName, 1); List<GridRegion> regions = m_GridService.GetRegionsByName(account.ScopeID, regionName, 1);
if ((regions == null) || (regions != null && regions.Count == 0)) if ((regions == null) || (regions != null && regions.Count == 0))
{ {
@ -429,6 +447,7 @@ namespace OpenSim.Services.LLLoginService
return null; return null;
} }
// Valid specification of a remote grid // Valid specification of a remote grid
regionName = parts[0]; regionName = parts[0];
string domainLocator = parts[1]; string domainLocator = parts[1];
parts = domainLocator.Split(new char[] {':'}); parts = domainLocator.Split(new char[] {':'});
@ -436,6 +455,7 @@ namespace OpenSim.Services.LLLoginService
uint port = 0; uint port = 0;
if (parts.Length > 1) if (parts.Length > 1)
UInt32.TryParse(parts[1], out port); UInt32.TryParse(parts[1], out port);
GridRegion region = FindForeignRegion(domainName, port, regionName, out gatekeeper); GridRegion region = FindForeignRegion(domainName, port, regionName, out gatekeeper);
return region; return region;
} }