aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs28
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs24
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs13
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiAvatarTests.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs12
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs6
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiListTests.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiNotecardTests.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiObjectTests.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiUserTests.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAttachmentTests.cs12
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs16
17 files changed, 48 insertions, 91 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index b4a8620..946680c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -104,11 +104,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
104 WaitHandle m_coopSleepHandle; 104 WaitHandle m_coopSleepHandle;
105 105
106 /// <summary> 106 /// <summary>
107 /// The timer used by the ScriptInstance to measure how long the script has executed.
108 /// </summary>
109 private Stopwatch m_executionTimer;
110
111 /// <summary>
112 /// The item that hosts this script 107 /// The item that hosts this script
113 /// </summary> 108 /// </summary>
114 protected TaskInventoryItem m_item; 109 protected TaskInventoryItem m_item;
@@ -267,14 +262,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
267 }; 262 };
268 263
269 public void Initialize( 264 public void Initialize(
270 IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle, 265 IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle)
271 Stopwatch executionTimer)
272 { 266 {
273 m_ScriptEngine = scriptEngine; 267 m_ScriptEngine = scriptEngine;
274 m_host = host; 268 m_host = host;
275 m_item = item; 269 m_item = item;
276 m_coopSleepHandle = coopSleepHandle; 270 m_coopSleepHandle = coopSleepHandle;
277 m_executionTimer = executionTimer;
278 271
279 LoadConfig(); 272 LoadConfig();
280 273
@@ -413,21 +406,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
413 406
414 protected virtual void Sleep(int delay) 407 protected virtual void Sleep(int delay)
415 { 408 {
416 if (m_executionTimer != null) 409 if (m_coopSleepHandle == null)
417 m_executionTimer.Stop(); // sleep time doesn't count as execution time, since it doesn't use the CPU 410 System.Threading.Thread.Sleep(delay);
418 411 else
419 try 412 CheckForCoopTermination(delay);
420 {
421 if (m_coopSleepHandle == null)
422 System.Threading.Thread.Sleep(delay);
423 else
424 CheckForCoopTermination(delay);
425 }
426 finally
427 {
428 if (m_executionTimer != null)
429 m_executionTimer.Start();
430 }
431 } 413 }
432 414
433 /// <summary> 415 /// <summary>
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
index 9bb12d3..3406aea 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs
@@ -51,7 +51,6 @@ using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list;
51using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion; 51using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
52using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; 52using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
53using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3; 53using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
54using System.Diagnostics;
55 54
56namespace OpenSim.Region.ScriptEngine.Shared.Api 55namespace OpenSim.Region.ScriptEngine.Shared.Api
57{ 56{
@@ -64,8 +63,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
64 internal IScriptModuleComms m_comms = null; 63 internal IScriptModuleComms m_comms = null;
65 64
66 public void Initialize( 65 public void Initialize(
67 IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle, 66 IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle)
68 Stopwatch executionTimer)
69 { 67 {
70 m_ScriptEngine = scriptEngine; 68 m_ScriptEngine = scriptEngine;
71 m_host = host; 69 m_host = host;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs
index 39505e1..92dd813 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs
@@ -51,7 +51,6 @@ using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list;
51using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion; 51using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
52using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; 52using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
53using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3; 53using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
54using System.Diagnostics;
55 54
56namespace OpenSim.Region.ScriptEngine.Shared.Api 55namespace OpenSim.Region.ScriptEngine.Shared.Api
57{ 56{
@@ -67,8 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
67 internal IScriptModuleComms m_comms = null; 66 internal IScriptModuleComms m_comms = null;
68 67
69 public void Initialize( 68 public void Initialize(
70 IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle, 69 IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle)
71 Stopwatch executionTimer)
72 { 70 {
73 m_ScriptEngine = scriptEngine; 71 m_ScriptEngine = scriptEngine;
74 m_host = host; 72 m_host = host;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 4bb0b74..123f8ca 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -41,7 +41,6 @@ using OpenMetaverse.StructuredData;
41using Nini.Config; 41using Nini.Config;
42using OpenSim; 42using OpenSim;
43using OpenSim.Framework; 43using OpenSim.Framework;
44using System.Diagnostics;
45 44
46using OpenSim.Framework.Console; 45using OpenSim.Framework.Console;
47using OpenSim.Region.Framework.Interfaces; 46using OpenSim.Region.Framework.Interfaces;
@@ -143,21 +142,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
143 internal float m_ScriptDistanceFactor = 1.0f; 142 internal float m_ScriptDistanceFactor = 1.0f;
144 internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >(); 143 internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >();
145 144
146 /// <summary>
147 /// The timer used by the ScriptInstance to measure how long the script has executed.
148 /// </summary>
149 private Stopwatch m_executionTimer;
150
151 protected IUrlModule m_UrlModule = null; 145 protected IUrlModule m_UrlModule = null;
152 146
153 public void Initialize( 147 public void Initialize(
154 IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle, 148 IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle)
155 Stopwatch executionTimer)
156 { 149 {
157 m_ScriptEngine = scriptEngine; 150 m_ScriptEngine = scriptEngine;
158 m_host = host; 151 m_host = host;
159 m_item = item; 152 m_item = item;
160 m_executionTimer = executionTimer;
161 153
162 m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>(); 154 m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();
163 155
@@ -440,19 +432,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
440 delay = (int)((float)delay * m_ScriptDelayFactor); 432 delay = (int)((float)delay * m_ScriptDelayFactor);
441 if (delay == 0) 433 if (delay == 0)
442 return; 434 return;
443 435 System.Threading.Thread.Sleep(delay);
444 if (m_executionTimer != null)
445 m_executionTimer.Stop(); // sleep time doesn't count as execution time, since it doesn't use the CPU
446
447 try
448 {
449 System.Threading.Thread.Sleep(delay);
450 }
451 finally
452 {
453 if (m_executionTimer != null)
454 m_executionTimer.Start();
455 }
456 } 436 }
457 437
458 public LSL_Integer osSetTerrainHeight(int x, int y, double val) 438 public LSL_Integer osSetTerrainHeight(int x, int y, double val)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
index 8033c90..8a744c3 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs
@@ -220,8 +220,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
220 220
221 private EventWaitHandle m_coopSleepHandle; 221 private EventWaitHandle m_coopSleepHandle;
222 222
223 private Stopwatch executionTimer = new Stopwatch();
224
225 public void ClearQueue() 223 public void ClearQueue()
226 { 224 {
227 m_TimerQueued = false; 225 m_TimerQueued = false;
@@ -293,7 +291,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
293 foreach (string api in am.GetApis()) 291 foreach (string api in am.GetApis())
294 { 292 {
295 m_Apis[api] = am.CreateApi(api); 293 m_Apis[api] = am.CreateApi(api);
296 m_Apis[api].Initialize(Engine, Part, ScriptTask, m_coopSleepHandle, executionTimer); 294 m_Apis[api].Initialize(Engine, Part, ScriptTask, m_coopSleepHandle);
297 } 295 }
298 296
299 try 297 try
@@ -768,7 +766,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
768 if (Suspended) 766 if (Suspended)
769 return 0; 767 return 0;
770 768
771 executionTimer.Restart(); 769 Stopwatch timer = new Stopwatch();
770 timer.Start();
772 771
773 try 772 try
774 { 773 {
@@ -776,9 +775,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
776 } 775 }
777 finally 776 finally
778 { 777 {
779 executionTimer.Stop(); 778 timer.Stop();
780 ExecutionTime.AddSample(executionTimer); 779 ExecutionTime.AddSample(timer);
781 Part.ParentGroup.Scene.AddScriptExecutionTime(executionTimer.ElapsedTicks); 780 Part.ParentGroup.Scene.AddScriptExecutionTime(timer.ElapsedTicks);
782 } 781 }
783 } 782 }
784 } 783 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiAvatarTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiAvatarTests.cs
index 06494b0..8170e9b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiAvatarTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiAvatarTests.cs
@@ -95,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
95 part.RotationOffset = new Quaternion(0.7071068f, 0, 0, 0.7071068f); 95 part.RotationOffset = new Quaternion(0.7071068f, 0, 0, 0.7071068f);
96 96
97 LSL_Api apiGrp1 = new LSL_Api(); 97 LSL_Api apiGrp1 = new LSL_Api();
98 apiGrp1.Initialize(m_engine, part, null, null, null); 98 apiGrp1.Initialize(m_engine, part, null, null);
99 99
100 ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId); 100 ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId);
101 101
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
index c3672d8..e35de9c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiHttpTests.cs
@@ -105,7 +105,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
105 // This is disconnected from the actual script - the mock engine does not set up any LSL_Api atm. 105 // This is disconnected from the actual script - the mock engine does not set up any LSL_Api atm.
106 // Possibly this could be done and we could obtain it directly from the MockScriptEngine. 106 // Possibly this could be done and we could obtain it directly from the MockScriptEngine.
107 m_lslApi = new LSL_Api(); 107 m_lslApi = new LSL_Api();
108 m_lslApi.Initialize(m_engine, so.RootPart, m_scriptItem, null, null); 108 m_lslApi.Initialize(m_engine, so.RootPart, m_scriptItem, null);
109 } 109 }
110 110
111 [TearDown] 111 [TearDown]
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs
index 96e0356..3ff4c6b 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs
@@ -94,7 +94,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
94 TaskInventoryHelpers.AddSceneObject(m_scene.AssetService, so1.RootPart, inventoryItemName, itemId, userId); 94 TaskInventoryHelpers.AddSceneObject(m_scene.AssetService, so1.RootPart, inventoryItemName, itemId, userId);
95 95
96 LSL_Api api = new LSL_Api(); 96 LSL_Api api = new LSL_Api();
97 api.Initialize(m_engine, so1.RootPart, null, null, null); 97 api.Initialize(m_engine, so1.RootPart, null, null);
98 98
99 // Create a second object 99 // Create a second object
100 SceneObjectGroup so2 = SceneHelpers.CreateSceneObject(1, userId, "so2", 0x100); 100 SceneObjectGroup so2 = SceneHelpers.CreateSceneObject(1, userId, "so2", 0x100);
@@ -127,7 +127,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
127 SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, user1Id, "so1", 0x10); 127 SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, user1Id, "so1", 0x10);
128 m_scene.AddSceneObject(so1); 128 m_scene.AddSceneObject(so1);
129 LSL_Api api = new LSL_Api(); 129 LSL_Api api = new LSL_Api();
130 api.Initialize(m_engine, so1.RootPart, null, null, null); 130 api.Initialize(m_engine, so1.RootPart, null, null);
131 131
132 // Create an object embedded inside the first 132 // Create an object embedded inside the first
133 UUID itemId = TestHelpers.ParseTail(0x20); 133 UUID itemId = TestHelpers.ParseTail(0x20);
@@ -137,7 +137,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
137 SceneObjectGroup so2 = SceneHelpers.CreateSceneObject(1, user2Id, "so2", 0x100); 137 SceneObjectGroup so2 = SceneHelpers.CreateSceneObject(1, user2Id, "so2", 0x100);
138 m_scene.AddSceneObject(so2); 138 m_scene.AddSceneObject(so2);
139 LSL_Api api2 = new LSL_Api(); 139 LSL_Api api2 = new LSL_Api();
140 api2.Initialize(m_engine, so2.RootPart, null, null, null); 140 api2.Initialize(m_engine, so2.RootPart, null, null);
141 141
142 // *** Firstly, we test where llAllowInventoryDrop() has not been called. *** 142 // *** Firstly, we test where llAllowInventoryDrop() has not been called. ***
143 api.llGiveInventory(so2.UUID.ToString(), inventoryItemName); 143 api.llGiveInventory(so2.UUID.ToString(), inventoryItemName);
@@ -184,7 +184,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
184 SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, user1Id, "so1", 0x10); 184 SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, user1Id, "so1", 0x10);
185 m_scene.AddSceneObject(so1); 185 m_scene.AddSceneObject(so1);
186 LSL_Api api = new LSL_Api(); 186 LSL_Api api = new LSL_Api();
187 api.Initialize(m_engine, so1.RootPart, null, null, null); 187 api.Initialize(m_engine, so1.RootPart, null, null);
188 188
189 // Create an object embedded inside the first 189 // Create an object embedded inside the first
190 UUID itemId = TestHelpers.ParseTail(0x20); 190 UUID itemId = TestHelpers.ParseTail(0x20);
@@ -218,7 +218,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
218 SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, user1Id, "so1", 0x10); 218 SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, user1Id, "so1", 0x10);
219 m_scene.AddSceneObject(so1); 219 m_scene.AddSceneObject(so1);
220 LSL_Api api = new LSL_Api(); 220 LSL_Api api = new LSL_Api();
221 api.Initialize(m_engine, so1.RootPart, null, null, null); 221 api.Initialize(m_engine, so1.RootPart, null, null);
222 222
223 // Create an object embedded inside the first 223 // Create an object embedded inside the first
224 UUID itemId = TestHelpers.ParseTail(0x20); 224 UUID itemId = TestHelpers.ParseTail(0x20);
@@ -250,7 +250,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
250 SceneObjectGroup sourceSo = SceneHelpers.AddSceneObject(m_scene, "sourceSo", user1Id); 250 SceneObjectGroup sourceSo = SceneHelpers.AddSceneObject(m_scene, "sourceSo", user1Id);
251 m_scene.AddSceneObject(sourceSo); 251 m_scene.AddSceneObject(sourceSo);
252 LSL_Api api = new LSL_Api(); 252 LSL_Api api = new LSL_Api();
253 api.Initialize(m_engine, sourceSo.RootPart, null, null, null); 253 api.Initialize(m_engine, sourceSo.RootPart, null, null);
254 TaskInventoryHelpers.AddScript(m_scene.AssetService, sourceSo.RootPart, "script", "Hello World"); 254 TaskInventoryHelpers.AddScript(m_scene.AssetService, sourceSo.RootPart, "script", "Hello World");
255 255
256 SceneObjectGroup targetSo = SceneHelpers.AddSceneObject(m_scene, "targetSo", user1Id); 256 SceneObjectGroup targetSo = SceneHelpers.AddSceneObject(m_scene, "targetSo", user1Id);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs
index 4323be0..b6f5e09 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiLinkingTests.cs
@@ -104,7 +104,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
104 m_scene.AddSceneObject(grp2); 104 m_scene.AddSceneObject(grp2);
105 105
106 LSL_Api apiGrp1 = new LSL_Api(); 106 LSL_Api apiGrp1 = new LSL_Api();
107 apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item, null, null); 107 apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item, null);
108 108
109 apiGrp1.llCreateLink(grp2.UUID.ToString(), ScriptBaseClass.TRUE); 109 apiGrp1.llCreateLink(grp2.UUID.ToString(), ScriptBaseClass.TRUE);
110 110
@@ -131,7 +131,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
131 grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; 131 grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
132 132
133 LSL_Api apiGrp1 = new LSL_Api(); 133 LSL_Api apiGrp1 = new LSL_Api();
134 apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item, null, null); 134 apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item, null);
135 135
136 apiGrp1.llBreakLink(2); 136 apiGrp1.llBreakLink(2);
137 137
@@ -160,7 +160,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
160 grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS; 160 grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
161 161
162 LSL_Api apiGrp1 = new LSL_Api(); 162 LSL_Api apiGrp1 = new LSL_Api();
163 apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item, null, null); 163 apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item, null);
164 164
165 apiGrp1.llBreakAllLinks(); 165 apiGrp1.llBreakAllLinks();
166 166
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiListTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiListTests.cs
index 6bbc7bb..0b1ae60 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiListTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiListTests.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
67 engine.AddRegion(scene); 67 engine.AddRegion(scene);
68 68
69 m_lslApi = new LSL_Api(); 69 m_lslApi = new LSL_Api();
70 m_lslApi.Initialize(engine, part, null, null, null); 70 m_lslApi.Initialize(engine, part, null, null);
71 } 71 }
72 72
73 [Test] 73 [Test]
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiNotecardTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiNotecardTests.cs
index 97d79e7..2ac12cb 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiNotecardTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiNotecardTests.cs
@@ -66,7 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
66 // This is disconnected from the actual script - the mock engine does not set up any LSL_Api atm. 66 // This is disconnected from the actual script - the mock engine does not set up any LSL_Api atm.
67 // Possibly this could be done and we could obtain it directly from the MockScriptEngine. 67 // Possibly this could be done and we could obtain it directly from the MockScriptEngine.
68 m_lslApi = new LSL_Api(); 68 m_lslApi = new LSL_Api();
69 m_lslApi.Initialize(m_engine, m_so.RootPart, m_scriptItem, null, null); 69 m_lslApi.Initialize(m_engine, m_so.RootPart, m_scriptItem, null);
70 } 70 }
71 71
72 [Test] 72 [Test]
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiObjectTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiObjectTests.cs
index b644814..caf2b05 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiObjectTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiObjectTests.cs
@@ -89,7 +89,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
89 m_scene.AddSceneObject(grp1); 89 m_scene.AddSceneObject(grp1);
90 90
91 LSL_Api apiGrp1 = new LSL_Api(); 91 LSL_Api apiGrp1 = new LSL_Api();
92 apiGrp1.Initialize(m_engine, grp1.RootPart, null, null, null); 92 apiGrp1.Initialize(m_engine, grp1.RootPart, null, null);
93 93
94 // Check simple 1 prim case 94 // Check simple 1 prim case
95 { 95 {
@@ -167,7 +167,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
167 Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part1), false), Is.True); 167 Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part1), false), Is.True);
168 168
169 LSL_Api apiGrp1 = new LSL_Api(); 169 LSL_Api apiGrp1 = new LSL_Api();
170 apiGrp1.Initialize(m_engine, part1, null, null, null); 170 apiGrp1.Initialize(m_engine, part1, null, null);
171 171
172 // Note that prim hollow check is passed with the other prim params in order to allow the 172 // Note that prim hollow check is passed with the other prim params in order to allow the
173 // specification of a different check value from the prim param. A cylinder, prism, sphere, 173 // specification of a different check value from the prim param. A cylinder, prism, sphere,
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
index f9907b6..1b7aa63 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
65 engine.AddRegion(scene); 65 engine.AddRegion(scene);
66 66
67 m_lslApi = new LSL_Api(); 67 m_lslApi = new LSL_Api();
68 m_lslApi.Initialize(engine, part, null, null, null); 68 m_lslApi.Initialize(engine, part, null, null);
69 } 69 }
70 70
71 [Test] 71 [Test]
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiUserTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiUserTests.cs
index e2546ad..40082b5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiUserTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiUserTests.cs
@@ -71,7 +71,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
71 TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, part); 71 TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, part);
72 72
73 LSL_Api apiGrp1 = new LSL_Api(); 73 LSL_Api apiGrp1 = new LSL_Api();
74 apiGrp1.Initialize(m_engine, part, scriptItem, null, null); 74 apiGrp1.Initialize(m_engine, part, scriptItem, null);
75 75
76 // Initially long timeout to test cache 76 // Initially long timeout to test cache
77 apiGrp1.LlRequestAgentDataCacheTimeoutMs = 20000; 77 apiGrp1.LlRequestAgentDataCacheTimeoutMs = 20000;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
index f452646..4c31969 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAppearanceTest.cs
@@ -93,7 +93,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
93 m_scene.AddSceneObject(so); 93 m_scene.AddSceneObject(so);
94 94
95 OSSL_Api osslApi = new OSSL_Api(); 95 OSSL_Api osslApi = new OSSL_Api();
96 osslApi.Initialize(m_engine, part, null, null, null); 96 osslApi.Initialize(m_engine, part, null, null);
97 97
98 string notecardName = "appearanceNc"; 98 string notecardName = "appearanceNc";
99 99
@@ -134,7 +134,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
134 m_scene.AddSceneObject(so); 134 m_scene.AddSceneObject(so);
135 135
136 OSSL_Api osslApi = new OSSL_Api(); 136 OSSL_Api osslApi = new OSSL_Api();
137 osslApi.Initialize(m_engine, part, null, null, null); 137 osslApi.Initialize(m_engine, part, null, null);
138 138
139 string notecardName = "appearanceNc"; 139 string notecardName = "appearanceNc";
140 140
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAttachmentTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAttachmentTests.cs
index 418f168..2fe558a 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAttachmentTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiAttachmentTests.cs
@@ -98,9 +98,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
98 SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID); 98 SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID);
99 TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart); 99 TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart);
100 100
101 new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null, null); 101 new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
102 OSSL_Api osslApi = new OSSL_Api(); 102 OSSL_Api osslApi = new OSSL_Api();
103 osslApi.Initialize(m_engine, inWorldObj.RootPart, scriptItem, null, null); 103 osslApi.Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
104 104
105// SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, ua1.PrincipalID); 105// SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, ua1.PrincipalID);
106 106
@@ -144,9 +144,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
144 SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID); 144 SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID);
145 TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart); 145 TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart);
146 146
147 new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null, null); 147 new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
148 OSSL_Api osslApi = new OSSL_Api(); 148 OSSL_Api osslApi = new OSSL_Api();
149 osslApi.Initialize(m_engine, inWorldObj.RootPart, scriptItem, null, null); 149 osslApi.Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
150 150
151 // Create an object embedded inside the first 151 // Create an object embedded inside the first
152 TaskInventoryHelpers.AddNotecard( 152 TaskInventoryHelpers.AddNotecard(
@@ -192,9 +192,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
192 SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID); 192 SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID);
193 TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart); 193 TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart);
194 194
195 new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null, null); 195 new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
196 OSSL_Api osslApi = new OSSL_Api(); 196 OSSL_Api osslApi = new OSSL_Api();
197 osslApi.Initialize(m_engine, inWorldObj.RootPart, scriptItem, null, null); 197 osslApi.Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
198 198
199 // Create an object embedded inside the first 199 // Create an object embedded inside the first
200 TaskInventoryHelpers.AddSceneObject( 200 TaskInventoryHelpers.AddSceneObject(
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs
index 2b7d70e..398ccbe 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Tests/OSSL_ApiNpcTests.cs
@@ -99,7 +99,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
99 m_scene.AddSceneObject(so); 99 m_scene.AddSceneObject(so);
100 100
101 OSSL_Api osslApi = new OSSL_Api(); 101 OSSL_Api osslApi = new OSSL_Api();
102 osslApi.Initialize(m_engine, part, null, null, null); 102 osslApi.Initialize(m_engine, part, null, null);
103 103
104 string notecardName = "appearanceNc"; 104 string notecardName = "appearanceNc";
105 osslApi.osOwnerSaveAppearance(notecardName); 105 osslApi.osOwnerSaveAppearance(notecardName);
@@ -125,7 +125,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
125 m_scene.AddSceneObject(so); 125 m_scene.AddSceneObject(so);
126 126
127 OSSL_Api osslApi = new OSSL_Api(); 127 OSSL_Api osslApi = new OSSL_Api();
128 osslApi.Initialize(m_engine, so.RootPart, null, null, null); 128 osslApi.Initialize(m_engine, so.RootPart, null, null);
129 129
130 bool gotExpectedException = false; 130 bool gotExpectedException = false;
131 try 131 try
@@ -160,7 +160,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
160 m_scene.AddSceneObject(so); 160 m_scene.AddSceneObject(so);
161 161
162 OSSL_Api osslApi = new OSSL_Api(); 162 OSSL_Api osslApi = new OSSL_Api();
163 osslApi.Initialize(m_engine, part, null, null, null); 163 osslApi.Initialize(m_engine, part, null, null);
164 164
165 string notecardName = "appearanceNc"; 165 string notecardName = "appearanceNc";
166 osslApi.osOwnerSaveAppearance(notecardName); 166 osslApi.osOwnerSaveAppearance(notecardName);
@@ -195,7 +195,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
195 m_scene.AddSceneObject(so); 195 m_scene.AddSceneObject(so);
196 196
197 OSSL_Api osslApi = new OSSL_Api(); 197 OSSL_Api osslApi = new OSSL_Api();
198 osslApi.Initialize(m_engine, part, null, null, null); 198 osslApi.Initialize(m_engine, part, null, null);
199 199
200 osslApi.osOwnerSaveAppearance(firstAppearanceNcName); 200 osslApi.osOwnerSaveAppearance(firstAppearanceNcName);
201 201
@@ -233,7 +233,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
233 m_scene.AddSceneObject(so); 233 m_scene.AddSceneObject(so);
234 234
235 OSSL_Api osslApi = new OSSL_Api(); 235 OSSL_Api osslApi = new OSSL_Api();
236 osslApi.Initialize(m_engine, part, null, null, null); 236 osslApi.Initialize(m_engine, part, null, null);
237 237
238 osslApi.osOwnerSaveAppearance(firstAppearanceNcName); 238 osslApi.osOwnerSaveAppearance(firstAppearanceNcName);
239 239
@@ -285,10 +285,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
285 m_scene.AddSceneObject(otherSo); 285 m_scene.AddSceneObject(otherSo);
286 286
287 OSSL_Api osslApi = new OSSL_Api(); 287 OSSL_Api osslApi = new OSSL_Api();
288 osslApi.Initialize(m_engine, part, null, null, null); 288 osslApi.Initialize(m_engine, part, null, null);
289 289
290 OSSL_Api otherOsslApi = new OSSL_Api(); 290 OSSL_Api otherOsslApi = new OSSL_Api();
291 otherOsslApi.Initialize(m_engine, otherPart, null, null, null); 291 otherOsslApi.Initialize(m_engine, otherPart, null, null);
292 292
293 string notecardName = "appearanceNc"; 293 string notecardName = "appearanceNc";
294 osslApi.osOwnerSaveAppearance(notecardName); 294 osslApi.osOwnerSaveAppearance(notecardName);
@@ -332,7 +332,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
332 m_scene.AddSceneObject(so); 332 m_scene.AddSceneObject(so);
333 333
334 OSSL_Api osslApi = new OSSL_Api(); 334 OSSL_Api osslApi = new OSSL_Api();
335 osslApi.Initialize(m_engine, part, null, null, null); 335 osslApi.Initialize(m_engine, part, null, null);
336 336
337 string notecardName = "appearanceNc"; 337 string notecardName = "appearanceNc";
338 osslApi.osOwnerSaveAppearance(notecardName); 338 osslApi.osOwnerSaveAppearance(notecardName);