Added new Util function for reading config vars that's more generic than the one I added yesterday -- this is for helping move config vars out of [Startup]

This commit is contained in:
Diva Canto
2013-02-22 15:57:33 -08:00
parent 0d08f81421
commit 0e8289cd00
13 changed files with 54 additions and 15 deletions

View File

@@ -128,7 +128,7 @@ namespace OpenSim.Services.GridService
m_MapTileDirectory = gridConfig.GetString("MapTileDirectory", "maptiles");
m_ThisGatekeeper = Util.GetConfigVarWithDefaultSection(config, "GatekeeperURI", "GridService");
m_ThisGatekeeper = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI", new string[] {"Startup", "GridService"});
// Legacy. Remove soon!
m_ThisGatekeeper = gridConfig.GetString("Gatekeeper", m_ThisGatekeeper);
try

View File

@@ -96,7 +96,7 @@ namespace OpenSim.Services.HypergridService
UUID.TryParse(scope, out m_ScopeID);
//m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!");
m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true);
m_ExternalName = Util.GetConfigVarWithDefaultSection(config, "GatekeeperURI", "GatekeeperService");
m_ExternalName = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI", new string[] {"Startup", "GatekeeperService"});
m_ExternalName = serverConfig.GetString("ExternalName", m_ExternalName);
if (m_ExternalName != string.Empty && !m_ExternalName.EndsWith("/"))
m_ExternalName = m_ExternalName + "/";

View File

@@ -81,7 +81,7 @@ namespace OpenSim.Services.HypergridService
if (m_UserAccountService == null)
throw new Exception(String.Format("Unable to create UserAccountService from {0}", userAccountsDll));
m_HomeURL = Util.GetConfigVarWithDefaultSection(config, "HomeURI", m_ConfigName);
m_HomeURL = Util.GetConfigVarFromSections<string>(config, "HomeURI", new string[] {"Startup", m_ConfigName});
m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);
}

View File

@@ -96,7 +96,7 @@ namespace OpenSim.Services.HypergridService
if (m_AvatarService == null)
throw new Exception(String.Format("Unable to create m_AvatarService from {0}", avatarDll));
m_HomeURL = Util.GetConfigVarWithDefaultSection(config, "HomeURI", m_ConfigName);
m_HomeURL = Util.GetConfigVarFromSections<string>(config, "HomeURI", new string[] {"Startup", m_ConfigName});
// m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);
}

View File

@@ -131,7 +131,7 @@ namespace OpenSim.Services.HypergridService
LoadDomainExceptionsFromConfig(serverConfig, "AllowExcept", m_TripsAllowedExceptions);
LoadDomainExceptionsFromConfig(serverConfig, "DisallowExcept", m_TripsDisallowedExceptions);
m_GridName = Util.GetConfigVarWithDefaultSection(config, "GatekeeperURI", "UserAgentService");
m_GridName = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI", new string[] {"Startup", "UserAgentService"});
if (string.IsNullOrEmpty(m_GridName)) // Legacy. Remove soon.
{
m_GridName = serverConfig.GetString("ExternalName", string.Empty);

View File

@@ -110,7 +110,7 @@ namespace OpenSim.Services.LLLoginService
m_RequireInventory = m_LoginServerConfig.GetBoolean("RequireInventory", true);
m_AllowRemoteSetLoginLevel = m_LoginServerConfig.GetBoolean("AllowRemoteSetLoginLevel", false);
m_MinLoginLevel = m_LoginServerConfig.GetInt("MinLoginLevel", 0);
m_GatekeeperURL = Util.GetConfigVarWithDefaultSection(config, "GatekeeperURI", "LoginService");
m_GatekeeperURL = Util.GetConfigVarFromSections<string>(config, "GatekeeperURI", new string[] {"Startup", "LoginService"});
m_MapTileURL = m_LoginServerConfig.GetString("MapTileURL", string.Empty);
m_ProfileURL = m_LoginServerConfig.GetString("ProfileServerURL", string.Empty);
m_OpenIDURL = m_LoginServerConfig.GetString("OpenIDServerURL", String.Empty);