aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorBlueWall2012-01-17 22:44:16 -0500
committerBlueWall2012-01-17 22:44:16 -0500
commite7619f75180d9d919bb7d077183596265f8d52a9 (patch)
tree71e5b0bd820cb48eeebd738450373dc7546ff5b5 /OpenSim
parentMerge branch 'master' of /home/opensim/src/opensim (diff)
parentAdd function osGetGridCustom (diff)
downloadopensim-SC_OLD-e7619f75180d9d919bb7d077183596265f8d52a9.zip
opensim-SC_OLD-e7619f75180d9d919bb7d077183596265f8d52a9.tar.gz
opensim-SC_OLD-e7619f75180d9d919bb7d077183596265f8d52a9.tar.bz2
opensim-SC_OLD-e7619f75180d9d919bb7d077183596265f8d52a9.tar.xz
Merge branch 'master' of /home/opensim/src/opensim
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs29
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs5
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);