diff options
author | Melanie | 2011-06-09 02:05:04 +0100 |
---|---|---|
committer | Melanie | 2011-06-09 02:05:04 +0100 |
commit | 326c46ba70cea70ddfe4aef9a6b73edff63e126a (patch) | |
tree | 5e76347b0d77f58717d8e5e4f3b8787ff01a18d7 /OpenSim/Services/LLLoginService | |
parent | Make the last otem in a list created with llCSV2List findable (diff) | |
parent | Consistency fix on the last commit. (diff) | |
download | opensim-SC_OLD-326c46ba70cea70ddfe4aef9a6b73edff63e126a.zip opensim-SC_OLD-326c46ba70cea70ddfe4aef9a6b73edff63e126a.tar.gz opensim-SC_OLD-326c46ba70cea70ddfe4aef9a6b73edff63e126a.tar.bz2 opensim-SC_OLD-326c46ba70cea70ddfe4aef9a6b73edff63e126a.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Services/LLLoginService')
-rw-r--r-- | OpenSim/Services/LLLoginService/LLLoginResponse.cs | 14 | ||||
-rw-r--r-- | OpenSim/Services/LLLoginService/LLLoginService.cs | 48 |
2 files changed, 48 insertions, 14 deletions
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index f8868f5..82acfbc 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs | |||
@@ -627,7 +627,19 @@ namespace OpenSim.Services.LLLoginService | |||
627 | if (finfo.TheirFlags == -1) | 627 | if (finfo.TheirFlags == -1) |
628 | continue; | 628 | continue; |
629 | LLLoginResponse.BuddyList.BuddyInfo buddyitem = new LLLoginResponse.BuddyList.BuddyInfo(finfo.Friend); | 629 | LLLoginResponse.BuddyList.BuddyInfo buddyitem = new LLLoginResponse.BuddyList.BuddyInfo(finfo.Friend); |
630 | buddyitem.BuddyID = finfo.Friend; | 630 | // finfo.Friend may not be a simple uuid |
631 | UUID friendID = UUID.Zero; | ||
632 | if (UUID.TryParse(finfo.Friend, out friendID)) | ||
633 | buddyitem.BuddyID = finfo.Friend; | ||
634 | else | ||
635 | { | ||
636 | string tmp; | ||
637 | if (Util.ParseUniversalUserIdentifier(finfo.Friend, out friendID, out tmp, out tmp, out tmp, out tmp)) | ||
638 | buddyitem.BuddyID = friendID.ToString(); | ||
639 | else | ||
640 | // junk entry | ||
641 | continue; | ||
642 | } | ||
631 | buddyitem.BuddyRightsHave = (int)finfo.TheirFlags; | 643 | buddyitem.BuddyRightsHave = (int)finfo.TheirFlags; |
632 | buddyitem.BuddyRightsGiven = (int)finfo.MyFlags; | 644 | buddyitem.BuddyRightsGiven = (int)finfo.MyFlags; |
633 | buddylistreturn.AddNewBuddy(buddyitem); | 645 | buddylistreturn.AddNewBuddy(buddyitem); |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index ffed15e..6683caf 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -523,6 +523,7 @@ namespace OpenSim.Services.LLLoginService | |||
523 | // free uri form | 523 | // free uri form |
524 | // e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34 | 524 | // e.g. New Moon&135&46 New Moon@osgrid.org:8002&153&34 |
525 | where = "url"; | 525 | where = "url"; |
526 | GridRegion region = null; | ||
526 | Regex reURI = new Regex(@"^uri:(?<region>[^&]+)&(?<x>\d+)&(?<y>\d+)&(?<z>\d+)$"); | 527 | Regex reURI = new Regex(@"^uri:(?<region>[^&]+)&(?<x>\d+)&(?<y>\d+)&(?<z>\d+)$"); |
527 | Match uriMatch = reURI.Match(startLocation); | 528 | Match uriMatch = reURI.Match(startLocation); |
528 | if (uriMatch == null) | 529 | if (uriMatch == null) |
@@ -553,8 +554,18 @@ namespace OpenSim.Services.LLLoginService | |||
553 | } | 554 | } |
554 | else | 555 | else |
555 | { | 556 | { |
556 | m_log.InfoFormat("[LLLOGIN SERVICE]: Got Custom Login URI {0}, Grid does not provide default regions.", startLocation); | 557 | m_log.Info("[LLOGIN SERVICE]: Last Region Not Found Attempting to find random region"); |
557 | return null; | 558 | region = FindAlternativeRegion(scopeID); |
559 | if (region != null) | ||
560 | { | ||
561 | where = "safe"; | ||
562 | return region; | ||
563 | } | ||
564 | else | ||
565 | { | ||
566 | m_log.InfoFormat("[LLLOGIN SERVICE]: Got Custom Login URI {0}, Grid does not provide default regions and no alternative found.", startLocation); | ||
567 | return null; | ||
568 | } | ||
558 | } | 569 | } |
559 | } | 570 | } |
560 | return regions[0]; | 571 | return regions[0]; |
@@ -582,7 +593,8 @@ namespace OpenSim.Services.LLLoginService | |||
582 | if (parts.Length > 1) | 593 | if (parts.Length > 1) |
583 | UInt32.TryParse(parts[1], out port); | 594 | UInt32.TryParse(parts[1], out port); |
584 | 595 | ||
585 | GridRegion region = FindForeignRegion(domainName, port, regionName, out gatekeeper); | 596 | // GridRegion region = FindForeignRegion(domainName, port, regionName, out gatekeeper); |
597 | region = FindForeignRegion(domainName, port, regionName, out gatekeeper); | ||
586 | return region; | 598 | return region; |
587 | } | 599 | } |
588 | } | 600 | } |
@@ -811,16 +823,13 @@ namespace OpenSim.Services.LLLoginService | |||
811 | // Old style: get the service keys from the DB | 823 | // Old style: get the service keys from the DB |
812 | foreach (KeyValuePair<string, object> kvp in account.ServiceURLs) | 824 | foreach (KeyValuePair<string, object> kvp in account.ServiceURLs) |
813 | { | 825 | { |
814 | if (kvp.Value == null || (kvp.Value != null && kvp.Value.ToString() == string.Empty)) | 826 | if (kvp.Value != null) |
815 | { | ||
816 | aCircuit.ServiceURLs[kvp.Key] = m_LoginServerConfig.GetString(kvp.Key, string.Empty); | ||
817 | } | ||
818 | else | ||
819 | { | 827 | { |
820 | aCircuit.ServiceURLs[kvp.Key] = kvp.Value; | 828 | aCircuit.ServiceURLs[kvp.Key] = kvp.Value; |
829 | |||
830 | if (!aCircuit.ServiceURLs[kvp.Key].ToString().EndsWith("/")) | ||
831 | aCircuit.ServiceURLs[kvp.Key] = aCircuit.ServiceURLs[kvp.Key] + "/"; | ||
821 | } | 832 | } |
822 | if (!aCircuit.ServiceURLs[kvp.Key].ToString().EndsWith("/")) | ||
823 | aCircuit.ServiceURLs[kvp.Key] = aCircuit.ServiceURLs[kvp.Key] + "/"; | ||
824 | } | 833 | } |
825 | 834 | ||
826 | // New style: service keys start with SRV_; override the previous | 835 | // New style: service keys start with SRV_; override the previous |
@@ -828,16 +837,29 @@ namespace OpenSim.Services.LLLoginService | |||
828 | 837 | ||
829 | if (keys.Length > 0) | 838 | if (keys.Length > 0) |
830 | { | 839 | { |
840 | bool newUrls = false; | ||
831 | IEnumerable<string> serviceKeys = keys.Where(value => value.StartsWith("SRV_")); | 841 | IEnumerable<string> serviceKeys = keys.Where(value => value.StartsWith("SRV_")); |
832 | foreach (string serviceKey in serviceKeys) | 842 | foreach (string serviceKey in serviceKeys) |
833 | { | 843 | { |
834 | string keyName = serviceKey.Replace("SRV_", ""); | 844 | string keyName = serviceKey.Replace("SRV_", ""); |
835 | aCircuit.ServiceURLs[keyName] = m_LoginServerConfig.GetString(serviceKey, string.Empty); | 845 | string keyValue = m_LoginServerConfig.GetString(serviceKey, string.Empty); |
836 | if (!aCircuit.ServiceURLs[keyName].ToString().EndsWith("/")) | 846 | if (!keyValue.EndsWith("/")) |
837 | aCircuit.ServiceURLs[keyName] = aCircuit.ServiceURLs[keyName] + "/"; | 847 | keyValue = keyValue + "/"; |
848 | |||
849 | if (!account.ServiceURLs.ContainsKey(keyName) || (account.ServiceURLs.ContainsKey(keyName) && account.ServiceURLs[keyName] != keyValue)) | ||
850 | { | ||
851 | account.ServiceURLs[keyName] = keyValue; | ||
852 | newUrls = true; | ||
853 | } | ||
854 | aCircuit.ServiceURLs[keyName] = keyValue; | ||
838 | 855 | ||
839 | m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]); | 856 | m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]); |
840 | } | 857 | } |
858 | |||
859 | // The grid operator decided to override the defaults in the | ||
860 | // [LoginService] configuration. Let's store the correct ones. | ||
861 | if (newUrls) | ||
862 | m_UserAccountService.StoreUserAccount(account); | ||
841 | } | 863 | } |
842 | 864 | ||
843 | } | 865 | } |