aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorunknown2010-03-27 08:16:41 +1300
committerDiva Canto2010-03-26 13:06:26 -0700
commit9fb17e7ab235cdf21b2b0865aadf31e3f63bd018 (patch)
treeff07fb596a6a8e6013b284cf8521a8eaaf44c805 /OpenSim
parentFixed a backwards null check that was preventing estate owner from being set ... (diff)
downloadopensim-SC_OLD-9fb17e7ab235cdf21b2b0865aadf31e3f63bd018.zip
opensim-SC_OLD-9fb17e7ab235cdf21b2b0865aadf31e3f63bd018.tar.gz
opensim-SC_OLD-9fb17e7ab235cdf21b2b0865aadf31e3f63bd018.tar.bz2
opensim-SC_OLD-9fb17e7ab235cdf21b2b0865aadf31e3f63bd018.tar.xz
Select Random Region if Home or Last cant be found
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs48
1 files changed, 34 insertions, 14 deletions
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 1eaf4d4..9846364 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -332,16 +332,24 @@ namespace OpenSim.Services.LLLoginService
332 332
333 if (tryDefaults) 333 if (tryDefaults)
334 { 334 {
335 List<GridRegion> defaults = m_GridService.GetDefaultRegions(account.ScopeID); 335 List<GridRegion> defaults = m_GridService.GetDefaultRegions(account.ScopeID);
336 if (defaults != null && defaults.Count > 0) 336 if (defaults != null && defaults.Count > 0)
337 { 337 {
338 region = defaults[0]; 338 region = defaults[0];
339 where = "safe"; 339 where = "safe";
340 }
341 else
342 {
343 m_log.WarnFormat("[LLOGIN SERVICE]: User {0} {1} does not have a valid home and this grid does not have default locations.",
344 account.FirstName, account.LastName);
345 m_log.Info("[LLOGIN SERVICE]: Home Region Not Found Attempting to find random region");
346 defaults = m_GridService.GetRegionsByName(account.ScopeID, "", 1);
347 if (defaults != null && defaults.Count > 0)
348 {
349 region = defaults[0];
350 where = "safe";
351 }
340 } 352 }
341 else
342 m_log.WarnFormat(
343 "[LLOGIN SERVICE]: User {0} {1} does not have a valid home and this grid does not have default locations.",
344 account.FirstName, account.LastName);
345 } 353 }
346 354
347 return region; 355 return region;
@@ -363,7 +371,18 @@ namespace OpenSim.Services.LLLoginService
363 { 371 {
364 region = defaults[0]; 372 region = defaults[0];
365 where = "safe"; 373 where = "safe";
374 }
375 else
376 {
377 m_log.Info("[LLOGIN SERVICE]: Last Region Not Found Attempting to find random region");
378 defaults = m_GridService.GetRegionsByName(account.ScopeID, "", 1);
379 if (defaults != null && defaults.Count > 0)
380 {
381 region = defaults[0];
382 where = "safe";
383 }
366 } 384 }
385
367 } 386 }
368 else 387 else
369 { 388 {
@@ -374,7 +393,7 @@ namespace OpenSim.Services.LLLoginService
374 return region; 393 return region;
375 } 394 }
376 else 395 else
377 { 396 {
378 // free uri form 397 // free uri form
379 // e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34 398 // e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34
380 where = "url"; 399 where = "url";
@@ -395,8 +414,7 @@ namespace OpenSim.Services.LLLoginService
395 if (regionName != null) 414 if (regionName != null)
396 { 415 {
397 if (!regionName.Contains("@")) 416 if (!regionName.Contains("@"))
398 { 417 {
399
400 List<GridRegion> regions = m_GridService.GetRegionsByName(account.ScopeID, regionName, 1); 418 List<GridRegion> regions = m_GridService.GetRegionsByName(account.ScopeID, regionName, 1);
401 if ((regions == null) || (regions != null && regions.Count == 0)) 419 if ((regions == null) || (regions != null && regions.Count == 0))
402 { 420 {
@@ -416,7 +434,7 @@ namespace OpenSim.Services.LLLoginService
416 return regions[0]; 434 return regions[0];
417 } 435 }
418 else 436 else
419 { 437 {
420 if (m_UserAgentService == null) 438 if (m_UserAgentService == null)
421 { 439 {
422 m_log.WarnFormat("[LLLOGIN SERVICE]: This llogin service is not running a user agent service, as such it can't lauch agents at foreign grids"); 440 m_log.WarnFormat("[LLLOGIN SERVICE]: This llogin service is not running a user agent service, as such it can't lauch agents at foreign grids");
@@ -428,7 +446,8 @@ namespace OpenSim.Services.LLLoginService
428 m_log.InfoFormat("[LLLOGIN SERVICE]: Got Custom Login URI {0}, can't locate region {1}", startLocation, regionName); 446 m_log.InfoFormat("[LLLOGIN SERVICE]: Got Custom Login URI {0}, can't locate region {1}", startLocation, regionName);
429 return null; 447 return null;
430 } 448 }
431 // Valid specification of a remote grid 449 // Valid specification of a remote grid
450
432 regionName = parts[0]; 451 regionName = parts[0];
433 string domainLocator = parts[1]; 452 string domainLocator = parts[1];
434 parts = domainLocator.Split(new char[] {':'}); 453 parts = domainLocator.Split(new char[] {':'});
@@ -436,6 +455,7 @@ namespace OpenSim.Services.LLLoginService
436 uint port = 0; 455 uint port = 0;
437 if (parts.Length > 1) 456 if (parts.Length > 1)
438 UInt32.TryParse(parts[1], out port); 457 UInt32.TryParse(parts[1], out port);
458
439 GridRegion region = FindForeignRegion(domainName, port, regionName, out gatekeeper); 459 GridRegion region = FindForeignRegion(domainName, port, regionName, out gatekeeper);
440 return region; 460 return region;
441 } 461 }