aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
authorBlueWall2012-01-17 22:38:36 -0500
committerBlueWall2012-01-17 22:38:36 -0500
commitba7d8cedeca1440fe4d4166308fec56fbbcdac19 (patch)
treec335490c2eca7b60c0506fd7a5bd242c3c07226b /OpenSim/Region/ScriptEngine/Shared/Api/Implementation
parentUpdate osGetGrid**** functions (diff)
downloadopensim-SC-ba7d8cedeca1440fe4d4166308fec56fbbcdac19.zip
opensim-SC-ba7d8cedeca1440fe4d4166308fec56fbbcdac19.tar.gz
opensim-SC-ba7d8cedeca1440fe4d4166308fec56fbbcdac19.tar.bz2
opensim-SC-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 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs29
1 files changed, 28 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");