LL Login now uses default regions if the desired start location is not found.

slimupdates
Diva Canto 2010-01-13 15:28:46 -08:00
parent 24ab3e2d5f
commit 14ab9b04c4
3 changed files with 41 additions and 10 deletions

View File

@ -252,14 +252,15 @@ namespace OpenSim.Services.LLLoginService
if (pinfo.HomeRegionID.Equals(UUID.Zero)) if (pinfo.HomeRegionID.Equals(UUID.Zero))
{ {
if (m_DefaultRegionName != string.Empty) List<GridRegion> defaults = m_GridService.GetDefaultRegions(account.ScopeID);
if (defaults != null && defaults.Count > 0)
{ {
region = m_GridService.GetRegionByName(account.ScopeID, m_DefaultRegionName); region = defaults[0];
where = "safe"; where = "safe";
} }
else else
m_log.WarnFormat("[LLOGIN SERVICE]: User {0} {1} does not have a home set and this grid does not have a default location." + m_log.WarnFormat("[LLOGIN SERVICE]: User {0} {1} does not have a home set and this grid does not have default locations.",
"Please specify DefaultRegion in [LoginService]", account.FirstName, account.LastName); account.FirstName, account.LastName);
} }
else else
region = m_GridService.GetRegionByUUID(account.ScopeID, pinfo.HomeRegionID); region = m_GridService.GetRegionByUUID(account.ScopeID, pinfo.HomeRegionID);
@ -280,9 +281,13 @@ namespace OpenSim.Services.LLLoginService
if (pinfo.RegionID.Equals(UUID.Zero)) if (pinfo.RegionID.Equals(UUID.Zero))
{ {
region = m_GridService.GetRegionByName(account.ScopeID, m_DefaultRegionName); List<GridRegion> defaults = m_GridService.GetDefaultRegions(account.ScopeID);
if (defaults != null && defaults.Count > 0)
{
region = defaults[0];
where = "safe"; where = "safe";
} }
}
else else
{ {
region = m_GridService.GetRegionByUUID(account.ScopeID, pinfo.RegionID); region = m_GridService.GetRegionByUUID(account.ScopeID, pinfo.RegionID);
@ -321,9 +326,19 @@ namespace OpenSim.Services.LLLoginService
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))
{ {
m_log.InfoFormat("[LLLOGIN SERVICE]: Got Custom Login URI {0}, can't locate region {1}", startLocation, regionName); m_log.InfoFormat("[LLLOGIN SERVICE]: Got Custom Login URI {0}, can't locate region {1}. Trying defaults.", startLocation, regionName);
regions = m_GridService.GetDefaultRegions(UUID.Zero);
if (regions != null && regions.Count > 0)
{
where = "safe";
return regions[0];
}
else
{
m_log.InfoFormat("[LLLOGIN SERVICE]: Got Custom Login URI {0}, Grid does not provide default regions.", startLocation);
return null; return null;
} }
}
return regions[0]; return regions[0];
} }
else else
@ -355,8 +370,14 @@ namespace OpenSim.Services.LLLoginService
if (m_PresenceService == null || m_GridService == null) if (m_PresenceService == null || m_GridService == null)
return null; return null;
return m_GridService.GetRegionByName(account.ScopeID, m_DefaultRegionName); List<GridRegion> defaults = m_GridService.GetDefaultRegions(account.ScopeID);
if (defaults != null && defaults.Count > 0)
{
where = "safe";
return defaults[0];
}
else
return null;
} }
} }
//response.LookAt = "[r0,r1,r0]"; //response.LookAt = "[r0,r1,r0]";

View File

@ -55,6 +55,11 @@ ServiceConnectors = "OpenSim.Server.Handlers.dll:AssetServiceConnector,OpenSim.S
StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData" StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim123;" ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim123;"
Realm = "regions" Realm = "regions"
;; Next, we can specify properties of regions, including default and fallback regions
;; The syntax is: Region_<RegioName> = "<flags>"
;; where <flags> can be DefaultRegion, FallbackRegion, NoDirectLogin, Persistent, LockedOut
;; For example:
Region_WelcomeArea = "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]

View File

@ -39,6 +39,11 @@
;;--- For MySql region storage (alternative) ;;--- For MySql region storage (alternative)
;StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData" ;StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData"
;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;" ;ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;"
;; Next, we can specify properties of regions, including default and fallback regions
;; The syntax is: Region_<RegioName> = "<flags>"
;; where <flags> can be DefaultRegion, FallbackRegion, NoDirectLogin, Persistent, LockedOut
;; For example:
Region_WelcomeArea = "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