Make use of Fallback regions when the desired start region is having problems.
parent
ab021aaa25
commit
283ff593b1
|
@ -108,7 +108,9 @@ namespace OpenSim.Services.LLLoginService
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
//
|
||||||
// Get the account and check that it exists
|
// Get the account and check that it exists
|
||||||
|
//
|
||||||
UserAccount account = m_UserAccountService.GetUserAccount(UUID.Zero, firstName, lastName);
|
UserAccount account = m_UserAccountService.GetUserAccount(UUID.Zero, firstName, lastName);
|
||||||
if (account == null)
|
if (account == null)
|
||||||
{
|
{
|
||||||
|
@ -122,7 +124,9 @@ namespace OpenSim.Services.LLLoginService
|
||||||
return LLFailedLoginResponse.LoginBlockedProblem;
|
return LLFailedLoginResponse.LoginBlockedProblem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
// Authenticate this user
|
// Authenticate this user
|
||||||
|
//
|
||||||
if (!passwd.StartsWith("$1$"))
|
if (!passwd.StartsWith("$1$"))
|
||||||
passwd = "$1$" + Util.Md5Hash(passwd);
|
passwd = "$1$" + Util.Md5Hash(passwd);
|
||||||
passwd = passwd.Remove(0, 3); //remove $1$
|
passwd = passwd.Remove(0, 3); //remove $1$
|
||||||
|
@ -134,7 +138,9 @@ namespace OpenSim.Services.LLLoginService
|
||||||
return LLFailedLoginResponse.UserProblem;
|
return LLFailedLoginResponse.UserProblem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
// Get the user's inventory
|
// Get the user's inventory
|
||||||
|
//
|
||||||
if (m_RequireInventory && m_InventoryService == null)
|
if (m_RequireInventory && m_InventoryService == null)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[LLOGIN SERVICE]: Login failed, reason: inventory service not set up");
|
m_log.WarnFormat("[LLOGIN SERVICE]: Login failed, reason: inventory service not set up");
|
||||||
|
@ -147,9 +153,9 @@ namespace OpenSim.Services.LLLoginService
|
||||||
return LLFailedLoginResponse.InventoryProblem;
|
return LLFailedLoginResponse.InventoryProblem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
// Login the presence
|
// Login the presence
|
||||||
// We may want to check for user already logged in, to
|
//
|
||||||
// stay compatible with what people expect...
|
|
||||||
PresenceInfo presence = null;
|
PresenceInfo presence = null;
|
||||||
GridRegion home = null;
|
GridRegion home = null;
|
||||||
if (m_PresenceService != null)
|
if (m_PresenceService != null)
|
||||||
|
@ -171,7 +177,9 @@ namespace OpenSim.Services.LLLoginService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
// Find the destination region/grid
|
// Find the destination region/grid
|
||||||
|
//
|
||||||
string where = string.Empty;
|
string where = string.Empty;
|
||||||
Vector3 position = Vector3.Zero;
|
Vector3 position = Vector3.Zero;
|
||||||
Vector3 lookAt = Vector3.Zero;
|
Vector3 lookAt = Vector3.Zero;
|
||||||
|
@ -183,14 +191,18 @@ namespace OpenSim.Services.LLLoginService
|
||||||
return LLFailedLoginResponse.GridProblem;
|
return LLFailedLoginResponse.GridProblem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
// Get the avatar
|
// Get the avatar
|
||||||
|
//
|
||||||
AvatarData avatar = null;
|
AvatarData avatar = null;
|
||||||
if (m_AvatarService != null)
|
if (m_AvatarService != null)
|
||||||
{
|
{
|
||||||
avatar = m_AvatarService.GetAvatar(account.PrincipalID);
|
avatar = m_AvatarService.GetAvatar(account.PrincipalID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
// Instantiate/get the simulation interface and launch an agent at the destination
|
// Instantiate/get the simulation interface and launch an agent at the destination
|
||||||
|
//
|
||||||
ISimulationService simConnector = null;
|
ISimulationService simConnector = null;
|
||||||
string reason = string.Empty;
|
string reason = string.Empty;
|
||||||
uint circuitCode = 0;
|
uint circuitCode = 0;
|
||||||
|
@ -210,14 +222,36 @@ namespace OpenSim.Services.LLLoginService
|
||||||
}
|
}
|
||||||
if (aCircuit == null)
|
if (aCircuit == null)
|
||||||
{
|
{
|
||||||
m_PresenceService.LogoutAgent(session, presence.Position, presence.LookAt);
|
// Try the fallback regions
|
||||||
m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: {0}", reason);
|
List<GridRegion> fallbacks = m_GridService.GetFallbackRegions(account.ScopeID, destination.RegionLocX, destination.RegionLocY);
|
||||||
return LLFailedLoginResponse.AuthorizationProblem;
|
if (fallbacks != null)
|
||||||
|
{
|
||||||
|
foreach (GridRegion r in fallbacks)
|
||||||
|
{
|
||||||
|
aCircuit = LaunchAgent(simConnector, r, account, avatar, session, secureSession, circuitCode, position, out reason);
|
||||||
|
if (aCircuit != null)
|
||||||
|
{
|
||||||
|
where = "safe";
|
||||||
|
destination = r;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aCircuit == null)
|
||||||
|
{
|
||||||
|
// we tried...
|
||||||
|
m_PresenceService.LogoutAgent(session, presence.Position, presence.LookAt);
|
||||||
|
m_log.InfoFormat("[LLOGIN SERVICE]: Login failed, reason: {0}", reason);
|
||||||
|
return LLFailedLoginResponse.AuthorizationProblem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Get Friends list...
|
// TODO: Get Friends list...
|
||||||
|
|
||||||
|
//
|
||||||
// Finally, fill out the response and return it
|
// Finally, fill out the response and return it
|
||||||
|
//
|
||||||
LLLoginResponse response = new LLLoginResponse(account, aCircuit, presence, destination, inventorySkel, m_LibraryService,
|
LLLoginResponse response = new LLLoginResponse(account, aCircuit, presence, destination, inventorySkel, m_LibraryService,
|
||||||
where, startLocation, position, lookAt, m_WelcomeMessage, home, clientIP);
|
where, startLocation, position, lookAt, m_WelcomeMessage, home, clientIP);
|
||||||
|
|
||||||
|
@ -239,12 +273,13 @@ namespace OpenSim.Services.LLLoginService
|
||||||
where = "home";
|
where = "home";
|
||||||
position = new Vector3(128, 128, 0);
|
position = new Vector3(128, 128, 0);
|
||||||
lookAt = new Vector3(0, 1, 0);
|
lookAt = new Vector3(0, 1, 0);
|
||||||
|
|
||||||
|
if (m_GridService == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
if (startLocation.Equals("home"))
|
if (startLocation.Equals("home"))
|
||||||
{
|
{
|
||||||
// logging into home region
|
// logging into home region
|
||||||
if (m_PresenceService == null || m_GridService == null)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
if (pinfo == null)
|
if (pinfo == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
@ -271,8 +306,6 @@ namespace OpenSim.Services.LLLoginService
|
||||||
{
|
{
|
||||||
// logging into last visited region
|
// logging into last visited region
|
||||||
where = "last";
|
where = "last";
|
||||||
if (m_PresenceService == null || m_GridService == null)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
if (pinfo == null)
|
if (pinfo == null)
|
||||||
return null;
|
return null;
|
||||||
|
@ -320,8 +353,6 @@ namespace OpenSim.Services.LLLoginService
|
||||||
{
|
{
|
||||||
if (!regionName.Contains("@"))
|
if (!regionName.Contains("@"))
|
||||||
{
|
{
|
||||||
if (m_GridService == null)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
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))
|
||||||
|
@ -363,13 +394,9 @@ namespace OpenSim.Services.LLLoginService
|
||||||
region.RegionName = regionName;
|
region.RegionName = regionName;
|
||||||
return region;
|
return region;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_PresenceService == null || m_GridService == null)
|
|
||||||
return null;
|
|
||||||
|
|
||||||
List<GridRegion> defaults = m_GridService.GetDefaultRegions(account.ScopeID);
|
List<GridRegion> defaults = m_GridService.GetDefaultRegions(account.ScopeID);
|
||||||
if (defaults != null && defaults.Count > 0)
|
if (defaults != null && defaults.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -58,8 +58,8 @@ ServiceConnectors = "OpenSim.Server.Handlers.dll:AssetServiceConnector,OpenSim.S
|
||||||
;; Next, we can specify properties of regions, including default and fallback regions
|
;; Next, we can specify properties of regions, including default and fallback regions
|
||||||
;; The syntax is: Region_<RegioName> = "<flags>"
|
;; The syntax is: Region_<RegioName> = "<flags>"
|
||||||
;; where <flags> can be DefaultRegion, FallbackRegion, NoDirectLogin, Persistent, LockedOut
|
;; where <flags> can be DefaultRegion, FallbackRegion, NoDirectLogin, Persistent, LockedOut
|
||||||
;; For example:
|
;; For example:
|
||||||
Region_WelcomeArea = "DefaultRegion, FallbackRegion"
|
Region_Welcome_Area = "DefaultRegion, FallbackRegion"
|
||||||
|
|
||||||
; * This is the configuration for the freeswitch server in grid mode
|
; * This is the configuration for the freeswitch server in grid mode
|
||||||
[FreeswitchService]
|
[FreeswitchService]
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
;; The syntax is: Region_<RegioName> = "<flags>"
|
;; The syntax is: Region_<RegioName> = "<flags>"
|
||||||
;; where <flags> can be DefaultRegion, FallbackRegion, NoDirectLogin, Persistent, LockedOut
|
;; where <flags> can be DefaultRegion, FallbackRegion, NoDirectLogin, Persistent, LockedOut
|
||||||
;; For example:
|
;; For example:
|
||||||
Region_WelcomeArea = "DefaultRegion, FallbackRegion"
|
Region_Welcome_Area = "DefaultRegion, FallbackRegion"
|
||||||
|
|
||||||
[LibraryModule]
|
[LibraryModule]
|
||||||
; Set this if you want to change the name of the OpenSim Library
|
; Set this if you want to change the name of the OpenSim Library
|
||||||
|
|
Loading…
Reference in New Issue