create osGetAvatarHomeURI

Signed-off-by: Melanie Thielker <melanie@t-data.com>
0.8.2-post-fixes
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");

View File

@ -283,6 +283,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
string osGetGridGatekeeperURI();
string osGetGridCustom(string key);
string osGetAvatarHomeURI(string uuid);
LSL_String osFormatString(string str, LSL_List strings);
LSL_List osMatchString(string src, string pattern, int start);
LSL_String osReplaceString(string src, string pattern, string replace, int count, int start);

View File

@ -510,6 +510,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osGetGridCustom(key);
}
public string osGetAvatarHomeURI(string uuid)
{
return m_OSSL_Functions.osGetAvatarHomeURI(uuid);
}
public LSL_String osFormatString(string str, LSL_List strings)
{
return m_OSSL_Functions.osFormatString(str, strings);

View File

@ -137,6 +137,7 @@
Allow_osLoadedCreationTime = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osMessageObject = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
Allow_osRegexIsMatch = true
Allow_osGetAvatarHomeURI = ${XEngine|osslParcelOG}ESTATE_MANAGER,ESTATE_OWNER
; ThreatLevel Moderate
Allow_osDropAttachment = ${XEngine|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER