aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs53
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/Tests/CoopTerminationTests.cs5
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
28using System;
29using System.Collections;
30using System.Collections.Generic;
31using System.Collections.Concurrent;
32using System.IO;
33using System.Reflection;
34using System.Runtime.Remoting.Lifetime;
35using System.Text;
36using System.Net;
37using System.Threading;
38using System.Xml;
39using log4net; 28using log4net;
29using Nini.Config;
40using OpenMetaverse; 30using OpenMetaverse;
41using OpenMetaverse.StructuredData; 31using OpenMetaverse.StructuredData;
42using Nini.Config;
43using OpenSim;
44using OpenSim.Framework; 32using OpenSim.Framework;
45
46using OpenSim.Framework.Console;
47using OpenSim.Region.Framework.Interfaces; 33using OpenSim.Region.Framework.Interfaces;
48using OpenSim.Region.Framework.Scenes; 34using OpenSim.Region.Framework.Scenes;
49using OpenSim.Region.Framework.Scenes.Scripting; 35using OpenSim.Region.Framework.Scenes.Scripting;
50using OpenSim.Region.ScriptEngine.Shared;
51using OpenSim.Region.ScriptEngine.Shared.Api.Plugins;
52using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
53using OpenSim.Region.ScriptEngine.Interfaces; 36using OpenSim.Region.ScriptEngine.Interfaces;
54using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces; 37using OpenSim.Region.ScriptEngine.Shared.Api.Interfaces;
55using TPFlags = OpenSim.Framework.Constants.TeleportFlags; 38using OpenSim.Region.ScriptEngine.Shared.ScriptBase;
39using OpenSim.Services.Connectors.Hypergrid;
56using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
57using GridRegion = OpenSim.Services.Interfaces.GridRegion; 41using System;
42using System.Collections;
43using System.Collections.Concurrent;
44using System.Collections.Generic;
45using System.Reflection;
46using System.Runtime.Remoting.Lifetime;
47using System.Text;
58using System.Text.RegularExpressions; 48using System.Text.RegularExpressions;
59 49using System.Threading;
50using GridRegion = OpenSim.Services.Interfaces.GridRegion;
60using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; 51using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat;
61using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger; 52using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger;
62using LSL_Key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; 53using LSL_Key = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
@@ -65,7 +56,7 @@ using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
65using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; 56using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
66using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3; 57using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
67using PermissionMask = OpenSim.Framework.PermissionMask; 58using PermissionMask = OpenSim.Framework.PermissionMask;
68using OpenSim.Services.Connectors.Hypergrid; 59using TPFlags = OpenSim.Framework.Constants.TeleportFlags;
69 60
70namespace OpenSim.Region.ScriptEngine.Shared.Api 61namespace 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();