aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-08-21 23:19:31 +0100
committerJustin Clark-Casey (justincc)2013-08-21 23:19:31 +0100
commit3d9b73c47a15cf00150ac80570fea88de8cecbdf (patch)
treebd3698292ba619aafd97f4380569db5b8730e84e
parentDon't allow users to attempt to sit on objects in a child region without goin... (diff)
downloadopensim-SC_OLD-3d9b73c47a15cf00150ac80570fea88de8cecbdf.zip
opensim-SC_OLD-3d9b73c47a15cf00150ac80570fea88de8cecbdf.tar.gz
opensim-SC_OLD-3d9b73c47a15cf00150ac80570fea88de8cecbdf.tar.bz2
opensim-SC_OLD-3d9b73c47a15cf00150ac80570fea88de8cecbdf.tar.xz
Implement ability for hg logins to try fallback regions just like local logins.
These would be specified in the [GridService] section of Robust.HG.ini, which already lists these in the example text. Untested patch so that Neb can easily pull in for testing, though shouldn't disrupt existing hg logins since fallback processing is a bit of code stuck on the end of the login sequence.
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs44
1 files changed, 39 insertions, 5 deletions
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index 0a3e70b..cbe1af0 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -326,7 +326,7 @@ namespace OpenSim.Services.HypergridService
326 return false; 326 return false;
327 } 327 }
328 328
329 m_log.DebugFormat("[GATEKEEPER SERVICE]: User is OK"); 329 m_log.DebugFormat("[GATEKEEPER SERVICE]: User {0} is ok", aCircuit.Name);
330 330
331 bool isFirstLogin = false; 331 bool isFirstLogin = false;
332 // 332 //
@@ -345,7 +345,7 @@ namespace OpenSim.Services.HypergridService
345 aCircuit.firstname, aCircuit.lastname); 345 aCircuit.firstname, aCircuit.lastname);
346 return false; 346 return false;
347 } 347 }
348 m_log.DebugFormat("[GATEKEEPER SERVICE]: Login presence ok"); 348 m_log.DebugFormat("[GATEKEEPER SERVICE]: Login presence {0} is ok", aCircuit.Name);
349 349
350 // Also login foreigners with GridUser service 350 // Also login foreigners with GridUser service
351 if (m_GridUserService != null && account == null) 351 if (m_GridUserService != null && account == null)
@@ -376,7 +376,8 @@ namespace OpenSim.Services.HypergridService
376 reason = "Destination region not found"; 376 reason = "Destination region not found";
377 return false; 377 return false;
378 } 378 }
379 m_log.DebugFormat("[GATEKEEPER SERVICE]: destination ok: {0}", destination.RegionName); 379 m_log.DebugFormat(
380 "[GATEKEEPER SERVICE]: Destination {0} is ok for {1}", destination.RegionName, aCircuit.Name);
380 381
381 // 382 //
382 // Adjust the visible name 383 // Adjust the visible name
@@ -410,8 +411,41 @@ namespace OpenSim.Services.HypergridService
410 // Preserve our TeleportFlags we have gathered so-far 411 // Preserve our TeleportFlags we have gathered so-far
411 loginFlag |= (Constants.TeleportFlags) aCircuit.teleportFlags; 412 loginFlag |= (Constants.TeleportFlags) aCircuit.teleportFlags;
412 413
413 m_log.DebugFormat("[GATEKEEPER SERVICE]: launching agent {0}", loginFlag); 414 m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0} {1}", aCircuit.Name, loginFlag);
414 return m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason); 415
416 bool success = m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason);
417
418 if (!success)
419 {
420 List<GridRegion> fallbackRegions = m_GridService.GetFallbackRegions(account.ScopeID, destination.RegionLocX, destination.RegionLocY);
421 if (fallbackRegions != null)
422 {
423 // Try the fallback regions
424 m_log.DebugFormat(
425 "[GATEKEEPER SERVICE]: Could not successfully log agent {0} into {1}. Trying fallback regions.",
426 aCircuit.Name, destination.RegionName);
427
428 foreach (GridRegion fallbackRegion in fallbackRegions)
429 {
430 m_log.DebugFormat(
431 "[GATEKEEPER SERVICE]: Trying fallback region {0} for {1}",
432 fallbackRegion.RegionName, aCircuit.Name);
433
434 success = m_SimulationService.CreateAgent(fallbackRegion, aCircuit, (uint)loginFlag, out reason);
435
436 if (success)
437 break;
438 }
439 }
440 else
441 {
442 m_log.DebugFormat(
443 "[GATEKEEPER SERVICE]: Could not successfully log agent {0} into {1} and no fallback regions to try.",
444 aCircuit.Name, destination.RegionName);
445 }
446 }
447
448 return success;
415 } 449 }
416 450
417 protected bool Authenticate(AgentCircuitData aCircuit) 451 protected bool Authenticate(AgentCircuitData aCircuit)