aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2008-10-03 06:15:23 +0000
committerMelanie Thielker2008-10-03 06:15:23 +0000
commitcffd73c59fb8cba3b93a1555173e3f4d5cda1258 (patch)
tree61736afec7c67767f7dd53afdc64ca961f0d5f80
parentPlumb in the start parameter in DNE (diff)
downloadopensim-SC_OLD-cffd73c59fb8cba3b93a1555173e3f4d5cda1258.zip
opensim-SC_OLD-cffd73c59fb8cba3b93a1555173e3f4d5cda1258.tar.gz
opensim-SC_OLD-cffd73c59fb8cba3b93a1555173e3f4d5cda1258.tar.bz2
opensim-SC_OLD-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 '')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs17
-rw-r--r--OpenSim/Region/ScriptEngine/Interfaces/IEventReceiver.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs2
-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
7 files changed, 45 insertions, 15 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
index 76bf41b..433a1c2 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
@@ -372,5 +372,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
372 controllingClient.SendScriptRunningReply(objectID, itemID, 372 controllingClient.SendScriptRunningReply(objectID, itemID,
373 id.Running); 373 id.Running);
374 } 374 }
375
376 public IScriptApi GetApi(UUID itemID, string name)
377 {
378 return m_ScriptManager.GetApi(itemID, name);
379 }
375 } 380 }
376} 381}
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index 875b29e..fc6024a 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -619,7 +619,24 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
619 619
620 InstanceData id = GetScript(localID, itemID); 620 InstanceData id = GetScript(localID, itemID);
621 621
622 if (id == null)
623 return 0;
624
622 return id.StartParam; 625 return id.StartParam;
623 } 626 }
627
628 public IScriptApi GetApi(UUID itemID, string name)
629 {
630 uint localID = GetLocalID(itemID);
631
632 InstanceData id = GetScript(localID, itemID);
633 if (id == null)
634 return null;
635
636 if (id.Apis.ContainsKey(name))
637 return id.Apis[name];
638
639 return null;
640 }
624 } 641 }
625} 642}
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IEventReceiver.cs b/OpenSim/Region/ScriptEngine/Interfaces/IEventReceiver.cs
index 084e279..898d670 100644
--- a/OpenSim/Region/ScriptEngine/Interfaces/IEventReceiver.cs
+++ b/OpenSim/Region/ScriptEngine/Interfaces/IEventReceiver.cs
@@ -66,5 +66,6 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
66 IConfig Config { get; } 66 IConfig Config { get; }
67 string ScriptEngineName { get; } 67 string ScriptEngineName { get; }
68 ILog Log { get; } 68 ILog Log { get; }
69 IScriptApi GetApi(UUID itemID, string name);
69 } 70 }
70} 71}
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs
index ccfbca8..5bd2f79 100644
--- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs
@@ -46,7 +46,5 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
46 /// Queue an event for execution 46 /// Queue an event for execution
47 /// </summary> 47 /// </summary>
48 IScriptWorkItem QueueEventHandler(object parms); 48 IScriptWorkItem QueueEventHandler(object parms);
49
50 IScriptApi GetApi(UUID itemID, string name);
51 } 49 }
52} 50}
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,