From e19031849ec2957f7312d7e2417bd8c8da0efc53 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 24 May 2011 09:38:03 -0700 Subject: Added necessary code to drop inventory on hg friends using the profile window, but can't test because this mechanism doesn't seem to work without a profile service. --- OpenSim/Services/LLLoginService/LLLoginService.cs | 30 +++++++++++++++-------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'OpenSim/Services/LLLoginService') diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 2ca2d15..a5a728b 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -804,16 +804,13 @@ namespace OpenSim.Services.LLLoginService // Old style: get the service keys from the DB foreach (KeyValuePair kvp in account.ServiceURLs) { - if (kvp.Value == null || (kvp.Value != null && kvp.Value.ToString() == string.Empty)) - { - aCircuit.ServiceURLs[kvp.Key] = m_LoginServerConfig.GetString(kvp.Key, string.Empty); - } - else + if (kvp.Value != null) { aCircuit.ServiceURLs[kvp.Key] = kvp.Value; + + if (!aCircuit.ServiceURLs[kvp.Key].ToString().EndsWith("/")) + aCircuit.ServiceURLs[kvp.Key] = aCircuit.ServiceURLs[kvp.Key] + "/"; } - if (!aCircuit.ServiceURLs[kvp.Key].ToString().EndsWith("/")) - aCircuit.ServiceURLs[kvp.Key] = aCircuit.ServiceURLs[kvp.Key] + "/"; } // New style: service keys start with SRV_; override the previous @@ -821,16 +818,29 @@ namespace OpenSim.Services.LLLoginService if (keys.Length > 0) { + bool newUrls = false; IEnumerable serviceKeys = keys.Where(value => value.StartsWith("SRV_")); foreach (string serviceKey in serviceKeys) { string keyName = serviceKey.Replace("SRV_", ""); - aCircuit.ServiceURLs[keyName] = m_LoginServerConfig.GetString(serviceKey, string.Empty); - if (!aCircuit.ServiceURLs[keyName].ToString().EndsWith("/")) - aCircuit.ServiceURLs[keyName] = aCircuit.ServiceURLs[keyName] + "/"; + string keyValue = m_LoginServerConfig.GetString(serviceKey, string.Empty); + if (!keyValue.EndsWith("/")) + keyValue = keyValue + "/"; + + if (!account.ServiceURLs.ContainsKey(keyName) || (account.ServiceURLs.ContainsKey(keyName) && account.ServiceURLs[keyName] != keyValue)) + { + account.ServiceURLs[keyName] = keyValue; + newUrls = true; + } + aCircuit.ServiceURLs[keyName] = keyValue; m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]); } + + // The grid operator decided to override the defaults in the + // [LoginService] configuration. Let's store the correct ones. + if (newUrls) + m_UserAccountService.StoreUserAccount(account); } } -- cgit v1.1