diff options
author | UbitUmarov | 2016-08-18 02:49:46 +0100 |
---|---|---|
committer | UbitUmarov | 2016-08-18 02:49:46 +0100 |
commit | 7dbc5803a6321dc13fccb3d7eef31963e2e28278 (patch) | |
tree | 257f6d9228e6e5205e6274a2f6af95d3007c6e09 /OpenSim | |
parent | fix region Allow damage and parcel safe flags handling (diff) | |
download | opensim-SC-7dbc5803a6321dc13fccb3d7eef31963e2e28278.zip opensim-SC-7dbc5803a6321dc13fccb3d7eef31963e2e28278.tar.gz opensim-SC-7dbc5803a6321dc13fccb3d7eef31963e2e28278.tar.bz2 opensim-SC-7dbc5803a6321dc13fccb3d7eef31963e2e28278.tar.xz |
in GetUsersNames(string[] ids) dont loose names HGFriends may have cached
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 2fd9183..640ca4e 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | |||
@@ -488,9 +488,10 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
488 | return ret; | 488 | return ret; |
489 | 489 | ||
490 | List<string> missing = new List<string>(); | 490 | List<string> missing = new List<string>(); |
491 | 491 | Dictionary<UUID,string> untried = new Dictionary<UUID, string>(); | |
492 | // look in cache | 492 | // look in cache |
493 | UserData userdata = new UserData(); | 493 | UserData userdata = new UserData(); |
494 | |||
494 | UUID uuid = UUID.Zero; | 495 | UUID uuid = UUID.Zero; |
495 | foreach(string id in ids) | 496 | foreach(string id in ids) |
496 | { | 497 | { |
@@ -499,11 +500,17 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
499 | lock (m_UserCache) | 500 | lock (m_UserCache) |
500 | { | 501 | { |
501 | if (m_UserCache.TryGetValue(uuid, out userdata) && | 502 | if (m_UserCache.TryGetValue(uuid, out userdata) && |
502 | userdata.HasGridUserTried && | ||
503 | userdata.FirstName != "Unknown") | 503 | userdata.FirstName != "Unknown") |
504 | { | 504 | { |
505 | string name = userdata.FirstName + " " + userdata.LastName; | 505 | string name = userdata.FirstName + " " + userdata.LastName; |
506 | ret[uuid] = name; | 506 | |
507 | if(userdata.HasGridUserTried) | ||
508 | ret[uuid] = name; | ||
509 | else | ||
510 | { | ||
511 | untried[uuid] = name; | ||
512 | missing.Add(id); | ||
513 | } | ||
507 | } | 514 | } |
508 | else | 515 | else |
509 | missing.Add(id); | 516 | missing.Add(id); |
@@ -527,6 +534,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
527 | string name = uac.FirstName + " " + uac.LastName; | 534 | string name = uac.FirstName + " " + uac.LastName; |
528 | ret[uac.PrincipalID] = name; | 535 | ret[uac.PrincipalID] = name; |
529 | missing.Remove(uac.PrincipalID.ToString()); // slowww | 536 | missing.Remove(uac.PrincipalID.ToString()); // slowww |
537 | untried.Remove(uac.PrincipalID); | ||
530 | 538 | ||
531 | userdata = new UserData(); | 539 | userdata = new UserData(); |
532 | userdata.Id = uac.PrincipalID; | 540 | userdata.Id = uac.PrincipalID; |
@@ -567,6 +575,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
567 | string name = first.Replace(" ", ".") + "." + last.Replace(" ", ".") + " @" + new Uri(url).Authority; | 575 | string name = first.Replace(" ", ".") + "." + last.Replace(" ", ".") + " @" + new Uri(url).Authority; |
568 | ret[u] = name; | 576 | ret[u] = name; |
569 | missing.Remove(u.ToString()); | 577 | missing.Remove(u.ToString()); |
578 | untried.Remove(u); | ||
570 | } | 579 | } |
571 | catch | 580 | catch |
572 | { | 581 | { |
@@ -577,6 +586,16 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement | |||
577 | } | 586 | } |
578 | } | 587 | } |
579 | 588 | ||
589 | // add the untried in cache that still failed | ||
590 | if(untried.Count > 0) | ||
591 | { | ||
592 | foreach(KeyValuePair<UUID, string> kvp in untried) | ||
593 | { | ||
594 | ret[kvp.Key] = kvp.Value; | ||
595 | missing.Remove(kvp.Key.ToString()); | ||
596 | } | ||
597 | } | ||
598 | |||
580 | // add the UMMthings ( not sure we should) | 599 | // add the UMMthings ( not sure we should) |
581 | if(missing.Count > 0) | 600 | if(missing.Count > 0) |
582 | { | 601 | { |