diff options
author | Melanie Thielker | 2008-10-03 01:30:22 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-10-03 01:30:22 +0000 |
commit | e30856a32f27ecb21b4b0f0b93e80539a631a1b2 (patch) | |
tree | 043ef62c12162072f5fa407eafd1201cf62017d7 /OpenSim | |
parent | Mantis #2282. (diff) | |
download | opensim-SC_OLD-e30856a32f27ecb21b4b0f0b93e80539a631a1b2.zip opensim-SC_OLD-e30856a32f27ecb21b4b0f0b93e80539a631a1b2.tar.gz opensim-SC_OLD-e30856a32f27ecb21b4b0f0b93e80539a631a1b2.tar.bz2 opensim-SC_OLD-e30856a32f27ecb21b4b0f0b93e80539a631a1b2.tar.xz |
Mantis #2317
Thank you, fusspawn, for an implementation of osGetSimulatorVersion.
This patch removes the llRequestSimulatorData(..., 128) hack and
implements the functionality as an osFunction.
Diffstat (limited to '')
4 files changed, 20 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 39e24b4..39636b6 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -7227,9 +7227,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7227 | else | 7227 | else |
7228 | reply = "UNKNOWN"; | 7228 | reply = "UNKNOWN"; |
7229 | break; | 7229 | break; |
7230 | case 128: // SIM_RELEASE (not LSL conform, valid for OpenSim only) | ||
7231 | reply = m_ScriptEngine.World.GetSimulatorVersion(); | ||
7232 | break; | ||
7233 | default: | 7230 | default: |
7234 | // ScriptSleep(1000); | 7231 | // ScriptSleep(1000); |
7235 | return UUID.Zero.ToString(); // Raise no event | 7232 | 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 7a9a648..c5e6359 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -30,6 +30,7 @@ using System.Collections.Generic; | |||
30 | using System.Runtime.Remoting.Lifetime; | 30 | using System.Runtime.Remoting.Lifetime; |
31 | using OpenMetaverse; | 31 | using OpenMetaverse; |
32 | using Nini.Config; | 32 | using Nini.Config; |
33 | using OpenSim; | ||
33 | using OpenSim.Framework.Console; | 34 | using OpenSim.Framework.Console; |
34 | using OpenSim.Region.Environment.Interfaces; | 35 | using OpenSim.Region.Environment.Interfaces; |
35 | using OpenSim.Region.Environment.Scenes; | 36 | using OpenSim.Region.Environment.Scenes; |
@@ -40,6 +41,7 @@ using OpenSim.Region.ScriptEngine.Interfaces; | |||
40 | using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; | 41 | using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; |
41 | using TPFlags = OpenSim.Framework.Constants.TeleportFlags; | 42 | using TPFlags = OpenSim.Framework.Constants.TeleportFlags; |
42 | 43 | ||
44 | |||
43 | namespace OpenSim.Region.ScriptEngine.Shared.Api | 45 | namespace OpenSim.Region.ScriptEngine.Shared.Api |
44 | { | 46 | { |
45 | ////////////////////////////////////////////////////////////// | 47 | ////////////////////////////////////////////////////////////// |
@@ -720,6 +722,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
720 | return String.Empty; | 722 | return String.Empty; |
721 | } | 723 | } |
722 | } | 724 | } |
725 | |||
726 | public string osGetSimulatorVersion() | ||
727 | { | ||
728 | // High because it can be used to target attacks to known weaknesses | ||
729 | // This would allow a new class of griefer scripts that don't even | ||
730 | // require their user to know what they are doing (see script | ||
731 | // kiddie) | ||
732 | // | ||
733 | CheckThreatLevel(ThreatLevel.High,"osGetSimulatorVersion"); | ||
734 | m_host.AddScriptLPS(1); | ||
735 | return m_ScriptEngine.World.GetSimulatorVersion(); | ||
736 | } | ||
723 | 737 | ||
724 | 738 | ||
725 | //for testing purposes only | 739 | //for testing purposes only |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index b2d6d3a..f486bd2 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -71,6 +71,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
71 | void osSetRegionWaterHeight(double height); | 71 | void osSetRegionWaterHeight(double height); |
72 | 72 | ||
73 | string osGetScriptEngineName(); | 73 | string osGetScriptEngineName(); |
74 | string osGetSimulatorVersion(); | ||
74 | void osSetParcelMediaTime(double time); | 75 | void osSetParcelMediaTime(double time); |
75 | Hashtable osParseJSON(string JSON); | 76 | Hashtable osParseJSON(string JSON); |
76 | 77 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 63d74b1..f3ca326 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -214,6 +214,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
214 | { | 214 | { |
215 | return m_OSSL_Functions.osGetScriptEngineName(); | 215 | return m_OSSL_Functions.osGetScriptEngineName(); |
216 | } | 216 | } |
217 | |||
218 | public string osGetSimulatorVersion() | ||
219 | { | ||
220 | return m_OSSL_Functions.osGetSimulatorVersion(); | ||
221 | } | ||
217 | 222 | ||
218 | 223 | ||
219 | //for testing purposes only | 224 | //for testing purposes only |