From 8f871cca10274325bf90054d75019a865fc50216 Mon Sep 17 00:00:00 2001 From: BlueWall Date: Thu, 19 Jan 2012 14:21:12 -0500 Subject: Add osGetGridHomeURI function Add osGetHomeURI function to the family of osGetGrid* functions. Returns the SRV_HomeURI setting from the [LoginService] configuration. --- .../Shared/Api/Implementation/OSSL_Api.cs | 22 ++++++++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 + .../ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 5 +++++ 3 files changed, 28 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index c682fda..7792ab5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1949,6 +1949,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api Nick, Name, Login, + Home, Custom }; @@ -1990,6 +1991,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api retval = json["login"]; break; + case InfoType.Home: + retval = json["home"]; + break; + case InfoType.Custom: retval = json[key]; break; @@ -2062,6 +2067,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return loginURI; } + public string osGetGridHomeURI() + { + CheckThreatLevel(ThreatLevel.Moderate, "osGetGridHomeURI"); + m_host.AddScriptLPS(1); + + string HomeURI = String.Empty; + IConfigSource config = m_ScriptEngine.ConfigSource; + + if (config.Configs["LoginService"] != null) + HomeURI = config.Configs["LoginService"].GetString("SRV_HomeURI", HomeURI); + + if (String.IsNullOrEmpty(HomeURI)) + HomeURI = GridUserInfo(InfoType.Home); + + return HomeURI; + } + public string osGetGridCustom(string key) { CheckThreatLevel(ThreatLevel.Moderate, "osGetGridCustom"); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index c1c4511..0f8cbdc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -160,6 +160,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces string osGetGridNick(); string osGetGridName(); string osGetGridLoginURI(); + string osGetGridHomeURI(); string osGetGridCustom(string key); LSL_String osFormatString(string str, LSL_List strings); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index fc83786..02efecf 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -452,6 +452,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osGetGridLoginURI(); } + public string osGetGridHomeURI() + { + return m_OSSL_Functions.osGetGridHomeURI(); + } + public string osGetGridCustom(string key) { return m_OSSL_Functions.osGetGridCustom(key); -- cgit v1.1