From ac72598c6bd974c426863262a1c5ac9210bd986c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 4 Jul 2016 08:29:26 +0100 Subject: add OSSL osGetPhysicsEngineName(). this returns a string with name and version. does no permition checks or it whould be less usefull ( only ubOde returns value) --- .../ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 16 ++++++++++++++++ .../ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | 1 + .../Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | 5 +++++ 3 files changed, 22 insertions(+) (limited to 'OpenSim/Region/ScriptEngine/Shared') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 90b7494..204f73e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -1724,6 +1724,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api return ret; } + public string osGetPhysicsEngineName() + { + // not doing security checks + // this whould limit the use of this + + m_host.AddScriptLPS(1); + string ret = "NoEngine"; + if (m_ScriptEngine.World.PhysicsScene != null) + { + ret = m_ScriptEngine.World.PhysicsScene.EngineName; + // An old physics engine might have an uninitialized engine type + if (ret == null) + ret = "UnknownEngine"; + } + return ret; + } public string osGetSimulatorVersion() { // High because it can be used to target attacks to known weaknesses diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index e1bb139..c1a177a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs @@ -262,6 +262,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces string osGetSimulatorVersion(); LSL_Integer osCheckODE(); string osGetPhysicsEngineType(); + string osGetPhysicsEngineName(); Object osParseJSONNew(string JSON); Hashtable osParseJSON(string JSON); diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 0022020..d586290 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs @@ -435,6 +435,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase return m_OSSL_Functions.osGetPhysicsEngineType(); } + public string osGetPhysicsEngineName() + { + return m_OSSL_Functions.osGetPhysicsEngineName(); + } + public string osGetSimulatorVersion() { return m_OSSL_Functions.osGetSimulatorVersion(); -- cgit v1.1