diff options
author | BlueWall | 2012-01-17 22:38:36 -0500 |
---|---|---|
committer | BlueWall | 2012-01-17 22:38:36 -0500 |
commit | ba7d8cedeca1440fe4d4166308fec56fbbcdac19 (patch) | |
tree | c335490c2eca7b60c0506fd7a5bd242c3c07226b /OpenSim/Region/ScriptEngine/Shared/Api | |
parent | Update osGetGrid**** functions (diff) | |
download | opensim-SC_OLD-ba7d8cedeca1440fe4d4166308fec56fbbcdac19.zip opensim-SC_OLD-ba7d8cedeca1440fe4d4166308fec56fbbcdac19.tar.gz opensim-SC_OLD-ba7d8cedeca1440fe4d4166308fec56fbbcdac19.tar.bz2 opensim-SC_OLD-ba7d8cedeca1440fe4d4166308fec56fbbcdac19.tar.xz |
Add function osGetGridCustom
Add function osGetGridCustom to take an argument for the GridInfo kpv to retrieve from the GridInfoService
Diffstat (limited to '')
3 files changed, 34 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index c7a62b3..c682fda 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1948,11 +1948,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1948 | { | 1948 | { |
1949 | Nick, | 1949 | Nick, |
1950 | Name, | 1950 | Name, |
1951 | Login | 1951 | Login, |
1952 | Custom | ||
1952 | }; | 1953 | }; |
1953 | 1954 | ||
1954 | private string GridUserInfo(InfoType type) | 1955 | private string GridUserInfo(InfoType type) |
1955 | { | 1956 | { |
1957 | return GridUserInfo(type, ""); | ||
1958 | } | ||
1959 | |||
1960 | private string GridUserInfo(InfoType type, string key) | ||
1961 | { | ||
1956 | string retval = String.Empty; | 1962 | string retval = String.Empty; |
1957 | IConfigSource config = m_ScriptEngine.ConfigSource; | 1963 | IConfigSource config = m_ScriptEngine.ConfigSource; |
1958 | string url = config.Configs["GridInfo"].GetString("GridInfoURI", String.Empty); | 1964 | string url = config.Configs["GridInfo"].GetString("GridInfoURI", String.Empty); |
@@ -1984,6 +1990,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1984 | retval = json["login"]; | 1990 | retval = json["login"]; |
1985 | break; | 1991 | break; |
1986 | 1992 | ||
1993 | case InfoType.Custom: | ||
1994 | retval = json[key]; | ||
1995 | break; | ||
1996 | |||
1987 | default: | 1997 | default: |
1988 | retval = "error"; | 1998 | retval = "error"; |
1989 | break; | 1999 | break; |
@@ -2052,6 +2062,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2052 | return loginURI; | 2062 | return loginURI; |
2053 | } | 2063 | } |
2054 | 2064 | ||
2065 | public string osGetGridCustom(string key) | ||
2066 | { | ||
2067 | CheckThreatLevel(ThreatLevel.Moderate, "osGetGridCustom"); | ||
2068 | m_host.AddScriptLPS(1); | ||
2069 | |||
2070 | string retval = String.Empty; | ||
2071 | IConfigSource config = m_ScriptEngine.ConfigSource; | ||
2072 | |||
2073 | if (config.Configs["GridInfo"] != null) | ||
2074 | retval = config.Configs["GridInfo"].GetString(key, retval); | ||
2075 | |||
2076 | if (String.IsNullOrEmpty(retval)) | ||
2077 | retval = GridUserInfo(InfoType.Custom, key); | ||
2078 | |||
2079 | return retval; | ||
2080 | } | ||
2081 | |||
2055 | public LSL_String osFormatString(string str, LSL_List strings) | 2082 | public LSL_String osFormatString(string str, LSL_List strings) |
2056 | { | 2083 | { |
2057 | CheckThreatLevel(ThreatLevel.Low, "osFormatString"); | 2084 | CheckThreatLevel(ThreatLevel.Low, "osFormatString"); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index af6be5f..c1c4511 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 | |||
160 | string osGetGridNick(); | 160 | string osGetGridNick(); |
161 | string osGetGridName(); | 161 | string osGetGridName(); |
162 | string osGetGridLoginURI(); | 162 | string osGetGridLoginURI(); |
163 | string osGetGridCustom(string key); | ||
163 | 164 | ||
164 | LSL_String osFormatString(string str, LSL_List strings); | 165 | LSL_String osFormatString(string str, LSL_List strings); |
165 | LSL_List osMatchString(string src, string pattern, int start); | 166 | LSL_List osMatchString(string src, string pattern, int start); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 0c05ea4..fc83786 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 | |||
452 | return m_OSSL_Functions.osGetGridLoginURI(); | 452 | return m_OSSL_Functions.osGetGridLoginURI(); |
453 | } | 453 | } |
454 | 454 | ||
455 | public string osGetGridCustom(string key) | ||
456 | { | ||
457 | return m_OSSL_Functions.osGetGridCustom(key); | ||
458 | } | ||
459 | |||
455 | public LSL_String osFormatString(string str, LSL_List strings) | 460 | public LSL_String osFormatString(string str, LSL_List strings) |
456 | { | 461 | { |
457 | return m_OSSL_Functions.osFormatString(str, strings); | 462 | return m_OSSL_Functions.osFormatString(str, strings); |