create osGetAvatarHomeURI

Signed-off-by: Melanie Thielker <melanie@t-data.com>
This commit is contained in:
Christopher
2015-08-04 09:00:24 +02:00
committed by Melanie Thielker
parent b5be5ca490
commit 86c426e587
4 changed files with 41 additions and 0 deletions

View File

@@ -2318,6 +2318,39 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return retval;
}
public string osGetAvatarHomeURI(string uuid)
{
CheckThreatLevel(ThreatLevel.Low, "osGetAvatarHomeURI");
m_host.AddScriptLPS(1);
IUserManagement userManager = m_ScriptEngine.World.RequestModuleInterface<IUserManagement>();
string returnValue = "";
if (userManager != null)
{
returnValue = userManager.GetUserServerURL(new UUID(uuid), "HomeURI");
}
if (returnValue == "")
{
IConfigSource config = m_ScriptEngine.ConfigSource;
returnValue = Util.GetConfigVarFromSections<string>(config, "HomeURI",
new string[] { "Startup", "Hypergrid" }, String.Empty);
if (!string.IsNullOrEmpty(returnValue))
return returnValue;
// Legacy. Remove soon!
if (config.Configs["LoginService"] != null)
returnValue = config.Configs["LoginService"].GetString("SRV_HomeURI", returnValue);
if (String.IsNullOrEmpty(returnValue))
returnValue = GridUserInfo(InfoType.Home);
}
return returnValue;
}
public LSL_String osFormatString(string str, LSL_List strings)
{
CheckThreatLevel(ThreatLevel.VeryLow, "osFormatString");