aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
authorMelanie Thielker2008-10-03 06:15:23 +0000
committerMelanie Thielker2008-10-03 06:15:23 +0000
commitcffd73c59fb8cba3b93a1555173e3f4d5cda1258 (patch)
tree61736afec7c67767f7dd53afdc64ca961f0d5f80 /OpenSim/Region/ScriptEngine/Shared
parentPlumb in the start parameter in DNE (diff)
downloadopensim-SC-cffd73c59fb8cba3b93a1555173e3f4d5cda1258.zip
opensim-SC-cffd73c59fb8cba3b93a1555173e3f4d5cda1258.tar.gz
opensim-SC-cffd73c59fb8cba3b93a1555173e3f4d5cda1258.tar.bz2
opensim-SC-cffd73c59fb8cba3b93a1555173e3f4d5cda1258.tar.xz
Reintroduces the discovery mechanism to use llRequestSimulatorData("", 128)
Causes the dataserver event to return "OpenSim" when running on OpenSim. Requires ThreatLevel to be "High" or above to function.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs7
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs14
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs14
3 files changed, 22 insertions, 13 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 4ae4fe2..783b1e4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -7182,6 +7182,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7182 7182
7183 public LSL_String llRequestSimulatorData(string simulator, int data) 7183 public LSL_String llRequestSimulatorData(string simulator, int data)
7184 { 7184 {
7185 IOSSL_Api ossl = (IOSSL_Api)m_ScriptEngine.GetApi(m_itemID, "OSSL");
7186
7185 try 7187 try
7186 { 7188 {
7187 m_host.AddScriptLPS(1); 7189 m_host.AddScriptLPS(1);
@@ -7223,6 +7225,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7223 else 7225 else
7224 reply = "UNKNOWN"; 7226 reply = "UNKNOWN";
7225 break; 7227 break;
7228 case 128:
7229 if (ossl != null)
7230 ossl.CheckThreatLevel(ThreatLevel.High, "llRequestSimulatorData");
7231 reply = "OpenSim";
7232 break;
7226 default: 7233 default:
7227 // ScriptSleep(1000); 7234 // ScriptSleep(1000);
7228 return UUID.Zero.ToString(); // Raise no event 7235 return UUID.Zero.ToString(); // Raise no event
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index c5e6359..bfe289c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -87,18 +87,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
87 // modification of user data, or allows the compromise of 87 // modification of user data, or allows the compromise of
88 // sensitive data by design. 88 // sensitive data by design.
89 89
90 public enum ThreatLevel
91 {
92 None = 0,
93 Nuisance = 1,
94 VeryLow = 2,
95 Low = 3,
96 Moderate = 4,
97 High = 5,
98 VeryHigh = 6,
99 Severe = 7
100 };
101
102 [Serializable] 90 [Serializable]
103 public class OSSL_Api : MarshalByRefObject, IOSSL_Api, IScriptApi 91 public class OSSL_Api : MarshalByRefObject, IOSSL_Api, IScriptApi
104 { 92 {
@@ -180,7 +168,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
180 throw new Exception("OSSL Runtime Error: " + msg); 168 throw new Exception("OSSL Runtime Error: " + msg);
181 } 169 }
182 170
183 protected void CheckThreatLevel(ThreatLevel level, string function) 171 public void CheckThreatLevel(ThreatLevel level, string function)
184 { 172 {
185 if (!m_OSFunctionsEnabled) 173 if (!m_OSFunctionsEnabled)
186 OSSLError(function+": permission denied"); // throws 174 OSSLError(function+": permission denied"); // throws
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index f486bd2..48eddd2 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -28,8 +28,22 @@ using System.Collections;
28using OpenSim.Region.ScriptEngine.Interfaces; 28using OpenSim.Region.ScriptEngine.Interfaces;
29namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces 29namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
30{ 30{
31 public enum ThreatLevel
32 {
33 None = 0,
34 Nuisance = 1,
35 VeryLow = 2,
36 Low = 3,
37 Moderate = 4,
38 High = 5,
39 VeryHigh = 6,
40 Severe = 7
41 };
42
31 public interface IOSSL_Api 43 public interface IOSSL_Api
32 { 44 {
45 void CheckThreatLevel(ThreatLevel level, string function);
46
33 //OpenSim functions 47 //OpenSim functions
34 string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer); 48 string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer);
35 string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, 49 string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams,