osKey2Name returns now correct values for HG users who are not on the region.

Signed-off-by: Oren Hurvitz <orenh@kitely.com>
0.8.2-post-fixes
Christopher 2015-07-31 22:16:38 +02:00 committed by Oren Hurvitz
parent c8cd2f18f5
commit bccf785665
1 changed files with 18 additions and 10 deletions

View File

@ -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