mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
create osGetAvatarHomeURI
Signed-off-by: Melanie Thielker <melanie@t-data.com>
This commit is contained in:
committed by
Melanie Thielker
parent
b5be5ca490
commit
86c426e587
@@ -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");
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user