diff options
Diffstat (limited to '')
5 files changed, 40 insertions, 26 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 3360b8d..641975a 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -25,38 +25,29 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
29 | using System.Collections; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Collections.Concurrent; | ||
32 | using System.IO; | ||
33 | using System.Reflection; | ||
34 | using System.Runtime.Remoting.Lifetime; | ||
35 | using System.Text; | ||
36 | using System.Net; | ||
37 | using System.Threading; | ||
38 | using System.Xml; | ||
39 | using log4net; | 28 | using log4net; |
29 | using Nini.Config; | ||
40 | using OpenMetaverse; | 30 | using OpenMetaverse; |
41 | using OpenMetaverse.StructuredData; | 31 | using OpenMetaverse.StructuredData; |
42 | using Nini.Config; | ||
43 | using OpenSim; | ||
44 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
45 | |||
46 | using OpenSim.Framework.Console; | ||
47 | using OpenSim.Region.Framework.Interfaces; | 33 | using OpenSim.Region.Framework.Interfaces; |
48 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
49 | using OpenSim.Region.Framework.Scenes.Scripting; | 35 | using OpenSim.Region.Framework.Scenes.Scripting; |
50 | using OpenSim.Region.ScriptEngine.Shared; | ||
51 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; | ||
52 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | ||
53 | using OpenSim.Region.ScriptEngine.Interfaces; | 36 | using OpenSim.Region.ScriptEngine.Interfaces; |
54 | using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; | 37 | using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; |
55 | using TPFlags = OpenSim.Framework.Constants.TeleportFlags; | 38 | using OpenSim.Region.ScriptEngine.Shared.ScriptBase; |
39 | using OpenSim.Services.Connectors.Hypergrid; | ||
56 | using OpenSim.Services.Interfaces; | 40 | using OpenSim.Services.Interfaces; |
57 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 41 | using System; |
42 | using System.Collections; | ||
43 | using System.Collections.Concurrent; | ||
44 | using System.Collections.Generic; | ||
45 | using System.Reflection; | ||
46 | using System.Runtime.Remoting.Lifetime; | ||
47 | using System.Text; | ||
58 | using System.Text.RegularExpressions; | 48 | using System.Text.RegularExpressions; |
59 | 49 | using System.Threading; | |
50 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | ||
60 | using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; | 51 | using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; |
61 | using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger; | 52 | using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger; |
62 | using LSL_Key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; | 53 | using LSL_Key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; |
@@ -65,7 +56,7 @@ using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion; | |||
65 | using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; | 56 | using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; |
66 | using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3; | 57 | using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3; |
67 | using PermissionMask = OpenSim.Framework.PermissionMask; | 58 | using PermissionMask = OpenSim.Framework.PermissionMask; |
68 | using OpenSim.Services.Connectors.Hypergrid; | 59 | using TPFlags = OpenSim.Framework.Constants.TeleportFlags; |
69 | 60 | ||
70 | namespace OpenSim.Region.ScriptEngine.Shared.Api | 61 | namespace OpenSim.Region.ScriptEngine.Shared.Api |
71 | { | 62 | { |
@@ -187,10 +178,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
187 | if(m_osslconfig == null) | 178 | if(m_osslconfig == null) |
188 | m_osslconfig = m_ScriptEngine.Config; | 179 | m_osslconfig = m_ScriptEngine.Config; |
189 | 180 | ||
190 | if (m_osslconfig.GetBoolean("AllowOSFunctions", false)) | 181 | if (m_osslconfig.GetBoolean("AllowOSFunctions", true)) |
191 | { | 182 | { |
192 | m_OSFunctionsEnabled = true; | 183 | m_OSFunctionsEnabled = true; |
193 | // m_log.Warn("[OSSL] OSSL FUNCTIONS ENABLED"); | 184 | // m_log.Warn("[OSSL] OSSL FUNCTIONS ENABLED"); |
194 | } | 185 | } |
195 | 186 | ||
196 | m_PermissionErrortoOwner = m_osslconfig.GetBoolean("PermissionErrorToOwner", m_PermissionErrortoOwner); | 187 | m_PermissionErrortoOwner = m_osslconfig.GetBoolean("PermissionErrorToOwner", m_PermissionErrortoOwner); |
@@ -5674,5 +5665,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5674 | m_ScriptEngine.ApiResetScript(me); | 5665 | m_ScriptEngine.ApiResetScript(me); |
5675 | 5666 | ||
5676 | } | 5667 | } |
5668 | |||
5669 | public LSL_Integer osIsNotValidNumber(LSL_Float v) | ||
5670 | { | ||
5671 | double d = v; | ||
5672 | if (double.IsNaN(d)) | ||
5673 | return 1; | ||
5674 | if (double.IsNegativeInfinity(d)) | ||
5675 | return 2; | ||
5676 | if (double.IsPositiveInfinity(d)) | ||
5677 | return 3; | ||
5678 | return 0; | ||
5679 | } | ||
5677 | } | 5680 | } |
5678 | } \ No newline at end of file | 5681 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index afbbe6f..2bb71e9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -558,5 +558,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
558 | LSL_Rotation osSlerp(LSL_Rotation a, LSL_Rotation b, LSL_Float amount); | 558 | LSL_Rotation osSlerp(LSL_Rotation a, LSL_Rotation b, LSL_Float amount); |
559 | 559 | ||
560 | void osResetAllScripts(LSL_Integer AllLinkset); | 560 | void osResetAllScripts(LSL_Integer AllLinkset); |
561 | LSL_Integer osIsNotValidNumber(LSL_Float v); | ||
561 | } | 562 | } |
562 | } | 563 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index e1c421f..f7acafe 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -35,7 +35,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
35 | public partial class ScriptBaseClass | 35 | public partial class ScriptBaseClass |
36 | { | 36 | { |
37 | // SCRIPTS CONSTANTS | 37 | // SCRIPTS CONSTANTS |
38 | public static readonly LSLInteger OS_APIVERSION = 9; | 38 | public static readonly LSLInteger OS_APIVERSION = 10; |
39 | 39 | ||
40 | public static readonly LSLInteger TRUE = 1; | 40 | public static readonly LSLInteger TRUE = 1; |
41 | public static readonly LSLInteger FALSE = 0; | 41 | public static readonly LSLInteger FALSE = 0; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index e13b6b0..9745403 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -1416,5 +1416,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
1416 | { | 1416 | { |
1417 | m_OSSL_Functions.osResetAllScripts(allLinkSet); | 1417 | m_OSSL_Functions.osResetAllScripts(allLinkSet); |
1418 | } | 1418 | } |
1419 | |||
1420 | public LSL_Integer osIsNotValidNumber(LSL_Float v) | ||
1421 | { | ||
1422 | return m_OSSL_Functions.osIsNotValidNumber(v); | ||
1423 | } | ||
1419 | } | 1424 | } |
1420 | } | 1425 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/Tests/CoopTerminationTests.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/Tests/CoopTerminationTests.cs index 8138117..a9671ae 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/Tests/CoopTerminationTests.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/Tests/CoopTerminationTests.cs | |||
@@ -106,6 +106,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance.Tests | |||
106 | // has an effect - without it tests will fail due to a 120 second wait for the event to finish. | 106 | // has an effect - without it tests will fail due to a 120 second wait for the event to finish. |
107 | xEngineConfig.Set("WaitForEventCompletionOnScriptStop", 120000); | 107 | xEngineConfig.Set("WaitForEventCompletionOnScriptStop", 120000); |
108 | 108 | ||
109 | IConfig config = configSource.AddConfig("OSSL"); | ||
110 | config.Set("DebuggerSafe", false); | ||
111 | config.Set("AllowOSFunctions", "true"); | ||
112 | config.Set("OSFunctionThreatLevel", "Severe"); | ||
113 | |||
109 | m_scene = new SceneHelpers().SetupScene("My Test", TestHelpers.ParseTail(0x9999), 1000, 1000, configSource); | 114 | m_scene = new SceneHelpers().SetupScene("My Test", TestHelpers.ParseTail(0x9999), 1000, 1000, configSource); |
110 | SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine); | 115 | SceneHelpers.SetupSceneModules(m_scene, configSource, m_xEngine); |
111 | m_scene.StartScripts(); | 116 | m_scene.StartScripts(); |