From bccf785665ad0749decf7b2ffb9fc059992017e5 Mon Sep 17 00:00:00 2001 From: Christopher Date: Fri, 31 Jul 2015 22:16:38 +0200 Subject: osKey2Name returns now correct values for HG users who are not on the region. Signed-off-by: Oren Hurvitz --- .../Shared/Api/Implementation/OSSL_Api.cs | 28 ++++++++++++++-------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 517a9d9..d42a125 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -2073,19 +2073,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api if (UUID.TryParse(id, out key)) { UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, key); - if (null == account) - { - return ""; - } - else - { + if (account != null) return account.Name; + + if (m_ScriptEngine.World.GridUserService != null) + { + GridUserInfo uInfo = m_ScriptEngine.World.GridUserService.GetGridUserInfo(key.ToString()); + + if (uInfo != null) + { + UUID userUUID; String gridURL; String firstName; String lastName; String tmp; + + if (Util.ParseUniversalUserIdentifier(uInfo.UserID, out userUUID, out gridURL, out firstName, out lastName, out tmp)) + { + string grid = new Uri(gridURL).Authority; + return firstName + "." + lastName + " @" + grid; + } + } } } - else - { - return ""; - } + + return ""; } private enum InfoType -- cgit v1.1