diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 7b928b1536..269bb46462 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -252,14 +252,15 @@ namespace OpenSim.Services.LLLoginService if (pinfo.HomeRegionID.Equals(UUID.Zero)) { - if (m_DefaultRegionName != string.Empty) + List 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"; } else - m_log.WarnFormat("[LLOGIN SERVICE]: User {0} {1} does not have a home set and this grid does not have a default location." + - "Please specify DefaultRegion in [LoginService]", account.FirstName, account.LastName); + m_log.WarnFormat("[LLOGIN SERVICE]: User {0} {1} does not have a home set and this grid does not have default locations.", + account.FirstName, account.LastName); } else region = m_GridService.GetRegionByUUID(account.ScopeID, pinfo.HomeRegionID); @@ -280,8 +281,12 @@ namespace OpenSim.Services.LLLoginService if (pinfo.RegionID.Equals(UUID.Zero)) { - region = m_GridService.GetRegionByName(account.ScopeID, m_DefaultRegionName); - where = "safe"; + List defaults = m_GridService.GetDefaultRegions(account.ScopeID); + if (defaults != null && defaults.Count > 0) + { + region = defaults[0]; + where = "safe"; + } } else { @@ -321,8 +326,18 @@ namespace OpenSim.Services.LLLoginService List regions = m_GridService.GetRegionsByName(account.ScopeID, regionName, 1); 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); - return null; + 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 regions[0]; } @@ -355,8 +370,14 @@ namespace OpenSim.Services.LLLoginService if (m_PresenceService == null || m_GridService == null) return null; - return m_GridService.GetRegionByName(account.ScopeID, m_DefaultRegionName); - + List 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]"; diff --git a/bin/OpenSim.Server.ini.example b/bin/OpenSim.Server.ini.example index 81b5302825..05deda2915 100644 --- a/bin/OpenSim.Server.ini.example +++ b/bin/OpenSim.Server.ini.example @@ -55,6 +55,11 @@ ServiceConnectors = "OpenSim.Server.Handlers.dll:AssetServiceConnector,OpenSim.S StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData" ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim123;" Realm = "regions" + ;; Next, we can specify properties of regions, including default and fallback regions + ;; The syntax is: Region_ = "" + ;; where can be DefaultRegion, FallbackRegion, NoDirectLogin, Persistent, LockedOut + ;; For example: + Region_WelcomeArea = "DefaultRegion, FallbackRegion" ; * This is the configuration for the freeswitch server in grid mode [FreeswitchService] diff --git a/bin/config-include/StandaloneCommon.ini.example b/bin/config-include/StandaloneCommon.ini.example index 1679f93777..ea03beda3e 100644 --- a/bin/config-include/StandaloneCommon.ini.example +++ b/bin/config-include/StandaloneCommon.ini.example @@ -39,6 +39,11 @@ ;;--- For MySql region storage (alternative) ;StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData" ;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_ = "" + ;; where can be DefaultRegion, FallbackRegion, NoDirectLogin, Persistent, LockedOut + ;; For example: + Region_WelcomeArea = "DefaultRegion, FallbackRegion" [LibraryModule] ; Set this if you want to change the name of the OpenSim Library