Revert "Make HG logins fall back to fallback regions if the desired region fails."
This is very similar to my earlier revert invarregionbcb8605f84
and fails for the same reasons. Reverting this change because it causes a problem if access is denied to the user. This reverts commitc7a8afbb8d
.
parent
1b2830b929
commit
0dd9a68eb7
|
@ -72,14 +72,11 @@ namespace OpenSim.Services.HypergridService
|
||||||
private static Uri m_Uri;
|
private static Uri m_Uri;
|
||||||
private static GridRegion m_DefaultGatewayRegion;
|
private static GridRegion m_DefaultGatewayRegion;
|
||||||
|
|
||||||
private static Random m_Random;
|
|
||||||
|
|
||||||
public GatekeeperService(IConfigSource config, ISimulationService simService)
|
public GatekeeperService(IConfigSource config, ISimulationService simService)
|
||||||
{
|
{
|
||||||
if (!m_Initialized)
|
if (!m_Initialized)
|
||||||
{
|
{
|
||||||
m_Initialized = true;
|
m_Initialized = true;
|
||||||
m_Random = new Random();
|
|
||||||
|
|
||||||
IConfig serverConfig = config.Configs["GatekeeperService"];
|
IConfig serverConfig = config.Configs["GatekeeperService"];
|
||||||
if (serverConfig == null)
|
if (serverConfig == null)
|
||||||
|
@ -223,8 +220,6 @@ namespace OpenSim.Services.HypergridService
|
||||||
public bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason)
|
public bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason)
|
||||||
{
|
{
|
||||||
reason = string.Empty;
|
reason = string.Empty;
|
||||||
List<GridRegion> defaultRegions;
|
|
||||||
List<GridRegion> fallbackRegions;
|
|
||||||
|
|
||||||
string authURL = string.Empty;
|
string authURL = string.Empty;
|
||||||
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
||||||
|
@ -379,14 +374,8 @@ namespace OpenSim.Services.HypergridService
|
||||||
destination = m_GridService.GetRegionByUUID(m_ScopeID, destination.RegionID);
|
destination = m_GridService.GetRegionByUUID(m_ScopeID, destination.RegionID);
|
||||||
if (destination == null)
|
if (destination == null)
|
||||||
{
|
{
|
||||||
defaultRegions = m_GridService.GetDefaultRegions(UUID.Zero);
|
reason = "Destination region not found";
|
||||||
if (defaultRegions == null || (defaultRegions != null && defaultRegions.Count == 0))
|
return false;
|
||||||
{
|
|
||||||
reason = "Destination region not found";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
int index = m_Random.Next(0, defaultRegions.Count - 1);
|
|
||||||
destination = defaultRegions[index];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
|
@ -426,17 +415,7 @@ namespace OpenSim.Services.HypergridService
|
||||||
|
|
||||||
m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0} {1}", aCircuit.Name, loginFlag);
|
m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0} {1}", aCircuit.Name, loginFlag);
|
||||||
|
|
||||||
// try login to the desired region
|
return m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason);
|
||||||
if (m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
// if that failed, try the fallbacks
|
|
||||||
fallbackRegions = m_GridService.GetFallbackRegions(UUID.Zero, destination.RegionLocX, destination.RegionLocY);
|
|
||||||
foreach (GridRegion r in fallbackRegions)
|
|
||||||
if (m_SimulationService.CreateAgent(r, aCircuit, (uint)loginFlag, out reason))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected bool Authenticate(AgentCircuitData aCircuit)
|
protected bool Authenticate(AgentCircuitData aCircuit)
|
||||||
|
|
Loading…
Reference in New Issue