Revert "When scripts are sleeping, don't count that as execution time"
The approach is good but the way it is written breaks the architecture.
Rewrite follows.
This reverts commit a568f06b7f
.
0.8.2-post-fixes
parent
1de5612d8b
commit
ee7debcca6
|
@ -26,7 +26,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using OpenMetaverse;
|
using OpenMetaverse;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
|
@ -46,9 +45,7 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
|
||||||
/// <param name='host'>/param>
|
/// <param name='host'>/param>
|
||||||
/// <param name='item'>/param>
|
/// <param name='item'>/param>
|
||||||
/// <param name='coopSleepHandle'>/param>
|
/// <param name='coopSleepHandle'>/param>
|
||||||
/// <param name="executionTimer">The timer used to measure how long the script has executed</param>
|
|
||||||
void Initialize(
|
void Initialize(
|
||||||
IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle,
|
IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle);
|
||||||
Stopwatch executionTimer);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -103,11 +103,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
/// <remarks>null if co-operative script termination is not active</remarks>
|
/// <remarks>null if co-operative script termination is not active</remarks>
|
||||||
WaitHandle m_coopSleepHandle;
|
WaitHandle m_coopSleepHandle;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The timer used by the ScriptInstance to measure how long the script has executed.
|
|
||||||
/// </summary>
|
|
||||||
private Stopwatch m_executionTimer;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The item that hosts this script
|
/// The item that hosts this script
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -267,14 +262,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
};
|
};
|
||||||
|
|
||||||
public void Initialize(
|
public void Initialize(
|
||||||
IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle,
|
IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle)
|
||||||
Stopwatch executionTimer)
|
|
||||||
{
|
{
|
||||||
m_ScriptEngine = scriptEngine;
|
m_ScriptEngine = scriptEngine;
|
||||||
m_host = host;
|
m_host = host;
|
||||||
m_item = item;
|
m_item = item;
|
||||||
m_coopSleepHandle = coopSleepHandle;
|
m_coopSleepHandle = coopSleepHandle;
|
||||||
m_executionTimer = executionTimer;
|
|
||||||
|
|
||||||
LoadConfig();
|
LoadConfig();
|
||||||
|
|
||||||
|
@ -412,23 +405,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void Sleep(int delay)
|
protected virtual void Sleep(int delay)
|
||||||
{
|
|
||||||
if (m_executionTimer != null)
|
|
||||||
m_executionTimer.Stop(); // sleep time doesn't count as execution time, since it doesn't use the CPU
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
if (m_coopSleepHandle == null)
|
if (m_coopSleepHandle == null)
|
||||||
System.Threading.Thread.Sleep(delay);
|
System.Threading.Thread.Sleep(delay);
|
||||||
else
|
else
|
||||||
CheckForCoopTermination(delay);
|
CheckForCoopTermination(delay);
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (m_executionTimer != null)
|
|
||||||
m_executionTimer.Start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Check for co-operative termination.
|
/// Check for co-operative termination.
|
||||||
|
|
|
@ -51,7 +51,6 @@ using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list;
|
||||||
using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
|
using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
|
||||||
using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
|
using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
|
||||||
using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
|
using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
|
||||||
using System.Diagnostics;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.ScriptEngine.Shared.Api
|
namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
|
@ -64,8 +63,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
internal IScriptModuleComms m_comms = null;
|
internal IScriptModuleComms m_comms = null;
|
||||||
|
|
||||||
public void Initialize(
|
public void Initialize(
|
||||||
IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle,
|
IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle)
|
||||||
Stopwatch executionTimer)
|
|
||||||
{
|
{
|
||||||
m_ScriptEngine = scriptEngine;
|
m_ScriptEngine = scriptEngine;
|
||||||
m_host = host;
|
m_host = host;
|
||||||
|
|
|
@ -51,7 +51,6 @@ using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list;
|
||||||
using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
|
using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion;
|
||||||
using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
|
using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString;
|
||||||
using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
|
using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3;
|
||||||
using System.Diagnostics;
|
|
||||||
|
|
||||||
namespace OpenSim.Region.ScriptEngine.Shared.Api
|
namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
|
@ -67,8 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
internal IScriptModuleComms m_comms = null;
|
internal IScriptModuleComms m_comms = null;
|
||||||
|
|
||||||
public void Initialize(
|
public void Initialize(
|
||||||
IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle,
|
IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle)
|
||||||
Stopwatch executionTimer)
|
|
||||||
{
|
{
|
||||||
m_ScriptEngine = scriptEngine;
|
m_ScriptEngine = scriptEngine;
|
||||||
m_host = host;
|
m_host = host;
|
||||||
|
|
|
@ -41,7 +41,6 @@ using OpenMetaverse.StructuredData;
|
||||||
using Nini.Config;
|
using Nini.Config;
|
||||||
using OpenSim;
|
using OpenSim;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using System.Diagnostics;
|
|
||||||
|
|
||||||
using OpenSim.Framework.Console;
|
using OpenSim.Framework.Console;
|
||||||
using OpenSim.Region.Framework.Interfaces;
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
|
@ -143,21 +142,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
internal float m_ScriptDistanceFactor = 1.0f;
|
internal float m_ScriptDistanceFactor = 1.0f;
|
||||||
internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >();
|
internal Dictionary<string, FunctionPerms > m_FunctionPerms = new Dictionary<string, FunctionPerms >();
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// The timer used by the ScriptInstance to measure how long the script has executed.
|
|
||||||
/// </summary>
|
|
||||||
private Stopwatch m_executionTimer;
|
|
||||||
|
|
||||||
protected IUrlModule m_UrlModule = null;
|
protected IUrlModule m_UrlModule = null;
|
||||||
|
|
||||||
public void Initialize(
|
public void Initialize(
|
||||||
IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle,
|
IScriptEngine scriptEngine, SceneObjectPart host, TaskInventoryItem item, WaitHandle coopSleepHandle)
|
||||||
Stopwatch executionTimer)
|
|
||||||
{
|
{
|
||||||
m_ScriptEngine = scriptEngine;
|
m_ScriptEngine = scriptEngine;
|
||||||
m_host = host;
|
m_host = host;
|
||||||
m_item = item;
|
m_item = item;
|
||||||
m_executionTimer = executionTimer;
|
|
||||||
|
|
||||||
m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();
|
m_UrlModule = m_ScriptEngine.World.RequestModuleInterface<IUrlModule>();
|
||||||
|
|
||||||
|
@ -440,20 +432,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
delay = (int)((float)delay * m_ScriptDelayFactor);
|
delay = (int)((float)delay * m_ScriptDelayFactor);
|
||||||
if (delay == 0)
|
if (delay == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_executionTimer != null)
|
|
||||||
m_executionTimer.Stop(); // sleep time doesn't count as execution time, since it doesn't use the CPU
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
System.Threading.Thread.Sleep(delay);
|
System.Threading.Thread.Sleep(delay);
|
||||||
}
|
}
|
||||||
finally
|
|
||||||
{
|
|
||||||
if (m_executionTimer != null)
|
|
||||||
m_executionTimer.Start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public LSL_Integer osSetTerrainHeight(int x, int y, double val)
|
public LSL_Integer osSetTerrainHeight(int x, int y, double val)
|
||||||
{
|
{
|
||||||
|
|
|
@ -220,8 +220,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
|
|
||||||
private EventWaitHandle m_coopSleepHandle;
|
private EventWaitHandle m_coopSleepHandle;
|
||||||
|
|
||||||
private Stopwatch executionTimer = new Stopwatch();
|
|
||||||
|
|
||||||
public void ClearQueue()
|
public void ClearQueue()
|
||||||
{
|
{
|
||||||
m_TimerQueued = false;
|
m_TimerQueued = false;
|
||||||
|
@ -293,7 +291,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
foreach (string api in am.GetApis())
|
foreach (string api in am.GetApis())
|
||||||
{
|
{
|
||||||
m_Apis[api] = am.CreateApi(api);
|
m_Apis[api] = am.CreateApi(api);
|
||||||
m_Apis[api].Initialize(Engine, Part, ScriptTask, m_coopSleepHandle, executionTimer);
|
m_Apis[api].Initialize(Engine, Part, ScriptTask, m_coopSleepHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -768,7 +766,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
if (Suspended)
|
if (Suspended)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
executionTimer.Restart();
|
Stopwatch timer = new Stopwatch();
|
||||||
|
timer.Start();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -776,9 +775,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
executionTimer.Stop();
|
timer.Stop();
|
||||||
ExecutionTime.AddSample(executionTimer);
|
ExecutionTime.AddSample(timer);
|
||||||
Part.ParentGroup.Scene.AddScriptExecutionTime(executionTimer.ElapsedTicks);
|
Part.ParentGroup.Scene.AddScriptExecutionTime(timer.ElapsedTicks);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
part.RotationOffset = new Quaternion(0.7071068f, 0, 0, 0.7071068f);
|
part.RotationOffset = new Quaternion(0.7071068f, 0, 0, 0.7071068f);
|
||||||
|
|
||||||
LSL_Api apiGrp1 = new LSL_Api();
|
LSL_Api apiGrp1 = new LSL_Api();
|
||||||
apiGrp1.Initialize(m_engine, part, null, null, null);
|
apiGrp1.Initialize(m_engine, part, null, null);
|
||||||
|
|
||||||
ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId);
|
ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, userId);
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
// This is disconnected from the actual script - the mock engine does not set up any LSL_Api atm.
|
// This is disconnected from the actual script - the mock engine does not set up any LSL_Api atm.
|
||||||
// Possibly this could be done and we could obtain it directly from the MockScriptEngine.
|
// Possibly this could be done and we could obtain it directly from the MockScriptEngine.
|
||||||
m_lslApi = new LSL_Api();
|
m_lslApi = new LSL_Api();
|
||||||
m_lslApi.Initialize(m_engine, so.RootPart, m_scriptItem, null, null);
|
m_lslApi.Initialize(m_engine, so.RootPart, m_scriptItem, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TearDown]
|
[TearDown]
|
||||||
|
|
|
@ -94,7 +94,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
TaskInventoryHelpers.AddSceneObject(m_scene.AssetService, so1.RootPart, inventoryItemName, itemId, userId);
|
TaskInventoryHelpers.AddSceneObject(m_scene.AssetService, so1.RootPart, inventoryItemName, itemId, userId);
|
||||||
|
|
||||||
LSL_Api api = new LSL_Api();
|
LSL_Api api = new LSL_Api();
|
||||||
api.Initialize(m_engine, so1.RootPart, null, null, null);
|
api.Initialize(m_engine, so1.RootPart, null, null);
|
||||||
|
|
||||||
// Create a second object
|
// Create a second object
|
||||||
SceneObjectGroup so2 = SceneHelpers.CreateSceneObject(1, userId, "so2", 0x100);
|
SceneObjectGroup so2 = SceneHelpers.CreateSceneObject(1, userId, "so2", 0x100);
|
||||||
|
@ -127,7 +127,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, user1Id, "so1", 0x10);
|
SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, user1Id, "so1", 0x10);
|
||||||
m_scene.AddSceneObject(so1);
|
m_scene.AddSceneObject(so1);
|
||||||
LSL_Api api = new LSL_Api();
|
LSL_Api api = new LSL_Api();
|
||||||
api.Initialize(m_engine, so1.RootPart, null, null, null);
|
api.Initialize(m_engine, so1.RootPart, null, null);
|
||||||
|
|
||||||
// Create an object embedded inside the first
|
// Create an object embedded inside the first
|
||||||
UUID itemId = TestHelpers.ParseTail(0x20);
|
UUID itemId = TestHelpers.ParseTail(0x20);
|
||||||
|
@ -137,7 +137,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
SceneObjectGroup so2 = SceneHelpers.CreateSceneObject(1, user2Id, "so2", 0x100);
|
SceneObjectGroup so2 = SceneHelpers.CreateSceneObject(1, user2Id, "so2", 0x100);
|
||||||
m_scene.AddSceneObject(so2);
|
m_scene.AddSceneObject(so2);
|
||||||
LSL_Api api2 = new LSL_Api();
|
LSL_Api api2 = new LSL_Api();
|
||||||
api2.Initialize(m_engine, so2.RootPart, null, null, null);
|
api2.Initialize(m_engine, so2.RootPart, null, null);
|
||||||
|
|
||||||
// *** Firstly, we test where llAllowInventoryDrop() has not been called. ***
|
// *** Firstly, we test where llAllowInventoryDrop() has not been called. ***
|
||||||
api.llGiveInventory(so2.UUID.ToString(), inventoryItemName);
|
api.llGiveInventory(so2.UUID.ToString(), inventoryItemName);
|
||||||
|
@ -184,7 +184,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, user1Id, "so1", 0x10);
|
SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, user1Id, "so1", 0x10);
|
||||||
m_scene.AddSceneObject(so1);
|
m_scene.AddSceneObject(so1);
|
||||||
LSL_Api api = new LSL_Api();
|
LSL_Api api = new LSL_Api();
|
||||||
api.Initialize(m_engine, so1.RootPart, null, null, null);
|
api.Initialize(m_engine, so1.RootPart, null, null);
|
||||||
|
|
||||||
// Create an object embedded inside the first
|
// Create an object embedded inside the first
|
||||||
UUID itemId = TestHelpers.ParseTail(0x20);
|
UUID itemId = TestHelpers.ParseTail(0x20);
|
||||||
|
@ -218,7 +218,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, user1Id, "so1", 0x10);
|
SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, user1Id, "so1", 0x10);
|
||||||
m_scene.AddSceneObject(so1);
|
m_scene.AddSceneObject(so1);
|
||||||
LSL_Api api = new LSL_Api();
|
LSL_Api api = new LSL_Api();
|
||||||
api.Initialize(m_engine, so1.RootPart, null, null, null);
|
api.Initialize(m_engine, so1.RootPart, null, null);
|
||||||
|
|
||||||
// Create an object embedded inside the first
|
// Create an object embedded inside the first
|
||||||
UUID itemId = TestHelpers.ParseTail(0x20);
|
UUID itemId = TestHelpers.ParseTail(0x20);
|
||||||
|
@ -250,7 +250,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
SceneObjectGroup sourceSo = SceneHelpers.AddSceneObject(m_scene, "sourceSo", user1Id);
|
SceneObjectGroup sourceSo = SceneHelpers.AddSceneObject(m_scene, "sourceSo", user1Id);
|
||||||
m_scene.AddSceneObject(sourceSo);
|
m_scene.AddSceneObject(sourceSo);
|
||||||
LSL_Api api = new LSL_Api();
|
LSL_Api api = new LSL_Api();
|
||||||
api.Initialize(m_engine, sourceSo.RootPart, null, null, null);
|
api.Initialize(m_engine, sourceSo.RootPart, null, null);
|
||||||
TaskInventoryHelpers.AddScript(m_scene.AssetService, sourceSo.RootPart, "script", "Hello World");
|
TaskInventoryHelpers.AddScript(m_scene.AssetService, sourceSo.RootPart, "script", "Hello World");
|
||||||
|
|
||||||
SceneObjectGroup targetSo = SceneHelpers.AddSceneObject(m_scene, "targetSo", user1Id);
|
SceneObjectGroup targetSo = SceneHelpers.AddSceneObject(m_scene, "targetSo", user1Id);
|
||||||
|
|
|
@ -104,7 +104,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
m_scene.AddSceneObject(grp2);
|
m_scene.AddSceneObject(grp2);
|
||||||
|
|
||||||
LSL_Api apiGrp1 = new LSL_Api();
|
LSL_Api apiGrp1 = new LSL_Api();
|
||||||
apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item, null, null);
|
apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item, null);
|
||||||
|
|
||||||
apiGrp1.llCreateLink(grp2.UUID.ToString(), ScriptBaseClass.TRUE);
|
apiGrp1.llCreateLink(grp2.UUID.ToString(), ScriptBaseClass.TRUE);
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
|
grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
|
||||||
|
|
||||||
LSL_Api apiGrp1 = new LSL_Api();
|
LSL_Api apiGrp1 = new LSL_Api();
|
||||||
apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item, null, null);
|
apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item, null);
|
||||||
|
|
||||||
apiGrp1.llBreakLink(2);
|
apiGrp1.llBreakLink(2);
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
|
grp1Item.PermsMask |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
|
||||||
|
|
||||||
LSL_Api apiGrp1 = new LSL_Api();
|
LSL_Api apiGrp1 = new LSL_Api();
|
||||||
apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item, null, null);
|
apiGrp1.Initialize(m_engine, grp1.RootPart, grp1Item, null);
|
||||||
|
|
||||||
apiGrp1.llBreakAllLinks();
|
apiGrp1.llBreakAllLinks();
|
||||||
|
|
||||||
|
|
|
@ -67,7 +67,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
engine.AddRegion(scene);
|
engine.AddRegion(scene);
|
||||||
|
|
||||||
m_lslApi = new LSL_Api();
|
m_lslApi = new LSL_Api();
|
||||||
m_lslApi.Initialize(engine, part, null, null, null);
|
m_lslApi.Initialize(engine, part, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
|
@ -66,7 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
// This is disconnected from the actual script - the mock engine does not set up any LSL_Api atm.
|
// This is disconnected from the actual script - the mock engine does not set up any LSL_Api atm.
|
||||||
// Possibly this could be done and we could obtain it directly from the MockScriptEngine.
|
// Possibly this could be done and we could obtain it directly from the MockScriptEngine.
|
||||||
m_lslApi = new LSL_Api();
|
m_lslApi = new LSL_Api();
|
||||||
m_lslApi.Initialize(m_engine, m_so.RootPart, m_scriptItem, null, null);
|
m_lslApi.Initialize(m_engine, m_so.RootPart, m_scriptItem, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
|
@ -89,7 +89,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
m_scene.AddSceneObject(grp1);
|
m_scene.AddSceneObject(grp1);
|
||||||
|
|
||||||
LSL_Api apiGrp1 = new LSL_Api();
|
LSL_Api apiGrp1 = new LSL_Api();
|
||||||
apiGrp1.Initialize(m_engine, grp1.RootPart, null, null, null);
|
apiGrp1.Initialize(m_engine, grp1.RootPart, null, null);
|
||||||
|
|
||||||
// Check simple 1 prim case
|
// Check simple 1 prim case
|
||||||
{
|
{
|
||||||
|
@ -167,7 +167,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part1), false), Is.True);
|
Assert.That(scene.AddNewSceneObject(new SceneObjectGroup(part1), false), Is.True);
|
||||||
|
|
||||||
LSL_Api apiGrp1 = new LSL_Api();
|
LSL_Api apiGrp1 = new LSL_Api();
|
||||||
apiGrp1.Initialize(m_engine, part1, null, null, null);
|
apiGrp1.Initialize(m_engine, part1, null, null);
|
||||||
|
|
||||||
// Note that prim hollow check is passed with the other prim params in order to allow the
|
// Note that prim hollow check is passed with the other prim params in order to allow the
|
||||||
// specification of a different check value from the prim param. A cylinder, prism, sphere,
|
// specification of a different check value from the prim param. A cylinder, prism, sphere,
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
engine.AddRegion(scene);
|
engine.AddRegion(scene);
|
||||||
|
|
||||||
m_lslApi = new LSL_Api();
|
m_lslApi = new LSL_Api();
|
||||||
m_lslApi.Initialize(engine, part, null, null, null);
|
m_lslApi.Initialize(engine, part, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
|
@ -71,7 +71,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, part);
|
TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, part);
|
||||||
|
|
||||||
LSL_Api apiGrp1 = new LSL_Api();
|
LSL_Api apiGrp1 = new LSL_Api();
|
||||||
apiGrp1.Initialize(m_engine, part, scriptItem, null, null);
|
apiGrp1.Initialize(m_engine, part, scriptItem, null);
|
||||||
|
|
||||||
// Initially long timeout to test cache
|
// Initially long timeout to test cache
|
||||||
apiGrp1.LlRequestAgentDataCacheTimeoutMs = 20000;
|
apiGrp1.LlRequestAgentDataCacheTimeoutMs = 20000;
|
||||||
|
|
|
@ -93,7 +93,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
m_scene.AddSceneObject(so);
|
m_scene.AddSceneObject(so);
|
||||||
|
|
||||||
OSSL_Api osslApi = new OSSL_Api();
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
osslApi.Initialize(m_engine, part, null, null, null);
|
osslApi.Initialize(m_engine, part, null, null);
|
||||||
|
|
||||||
string notecardName = "appearanceNc";
|
string notecardName = "appearanceNc";
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
m_scene.AddSceneObject(so);
|
m_scene.AddSceneObject(so);
|
||||||
|
|
||||||
OSSL_Api osslApi = new OSSL_Api();
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
osslApi.Initialize(m_engine, part, null, null, null);
|
osslApi.Initialize(m_engine, part, null, null);
|
||||||
|
|
||||||
string notecardName = "appearanceNc";
|
string notecardName = "appearanceNc";
|
||||||
|
|
||||||
|
|
|
@ -98,9 +98,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID);
|
SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID);
|
||||||
TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart);
|
TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart);
|
||||||
|
|
||||||
new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null, null);
|
new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
|
||||||
OSSL_Api osslApi = new OSSL_Api();
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
osslApi.Initialize(m_engine, inWorldObj.RootPart, scriptItem, null, null);
|
osslApi.Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
|
||||||
|
|
||||||
// SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, ua1.PrincipalID);
|
// SceneObjectGroup sog1 = SceneHelpers.CreateSceneObject(1, ua1.PrincipalID);
|
||||||
|
|
||||||
|
@ -144,9 +144,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID);
|
SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID);
|
||||||
TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart);
|
TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart);
|
||||||
|
|
||||||
new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null, null);
|
new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
|
||||||
OSSL_Api osslApi = new OSSL_Api();
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
osslApi.Initialize(m_engine, inWorldObj.RootPart, scriptItem, null, null);
|
osslApi.Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
|
||||||
|
|
||||||
// Create an object embedded inside the first
|
// Create an object embedded inside the first
|
||||||
TaskInventoryHelpers.AddNotecard(
|
TaskInventoryHelpers.AddNotecard(
|
||||||
|
@ -192,9 +192,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID);
|
SceneObjectGroup inWorldObj = SceneHelpers.AddSceneObject(m_scene, "inWorldObj", ua1.PrincipalID);
|
||||||
TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart);
|
TaskInventoryItem scriptItem = TaskInventoryHelpers.AddScript(m_scene.AssetService, inWorldObj.RootPart);
|
||||||
|
|
||||||
new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null, null);
|
new LSL_Api().Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
|
||||||
OSSL_Api osslApi = new OSSL_Api();
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
osslApi.Initialize(m_engine, inWorldObj.RootPart, scriptItem, null, null);
|
osslApi.Initialize(m_engine, inWorldObj.RootPart, scriptItem, null);
|
||||||
|
|
||||||
// Create an object embedded inside the first
|
// Create an object embedded inside the first
|
||||||
TaskInventoryHelpers.AddSceneObject(
|
TaskInventoryHelpers.AddSceneObject(
|
||||||
|
|
|
@ -99,7 +99,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
m_scene.AddSceneObject(so);
|
m_scene.AddSceneObject(so);
|
||||||
|
|
||||||
OSSL_Api osslApi = new OSSL_Api();
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
osslApi.Initialize(m_engine, part, null, null, null);
|
osslApi.Initialize(m_engine, part, null, null);
|
||||||
|
|
||||||
string notecardName = "appearanceNc";
|
string notecardName = "appearanceNc";
|
||||||
osslApi.osOwnerSaveAppearance(notecardName);
|
osslApi.osOwnerSaveAppearance(notecardName);
|
||||||
|
@ -125,7 +125,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
m_scene.AddSceneObject(so);
|
m_scene.AddSceneObject(so);
|
||||||
|
|
||||||
OSSL_Api osslApi = new OSSL_Api();
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
osslApi.Initialize(m_engine, so.RootPart, null, null, null);
|
osslApi.Initialize(m_engine, so.RootPart, null, null);
|
||||||
|
|
||||||
bool gotExpectedException = false;
|
bool gotExpectedException = false;
|
||||||
try
|
try
|
||||||
|
@ -160,7 +160,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
m_scene.AddSceneObject(so);
|
m_scene.AddSceneObject(so);
|
||||||
|
|
||||||
OSSL_Api osslApi = new OSSL_Api();
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
osslApi.Initialize(m_engine, part, null, null, null);
|
osslApi.Initialize(m_engine, part, null, null);
|
||||||
|
|
||||||
string notecardName = "appearanceNc";
|
string notecardName = "appearanceNc";
|
||||||
osslApi.osOwnerSaveAppearance(notecardName);
|
osslApi.osOwnerSaveAppearance(notecardName);
|
||||||
|
@ -195,7 +195,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
m_scene.AddSceneObject(so);
|
m_scene.AddSceneObject(so);
|
||||||
|
|
||||||
OSSL_Api osslApi = new OSSL_Api();
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
osslApi.Initialize(m_engine, part, null, null, null);
|
osslApi.Initialize(m_engine, part, null, null);
|
||||||
|
|
||||||
osslApi.osOwnerSaveAppearance(firstAppearanceNcName);
|
osslApi.osOwnerSaveAppearance(firstAppearanceNcName);
|
||||||
|
|
||||||
|
@ -233,7 +233,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
m_scene.AddSceneObject(so);
|
m_scene.AddSceneObject(so);
|
||||||
|
|
||||||
OSSL_Api osslApi = new OSSL_Api();
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
osslApi.Initialize(m_engine, part, null, null, null);
|
osslApi.Initialize(m_engine, part, null, null);
|
||||||
|
|
||||||
osslApi.osOwnerSaveAppearance(firstAppearanceNcName);
|
osslApi.osOwnerSaveAppearance(firstAppearanceNcName);
|
||||||
|
|
||||||
|
@ -285,10 +285,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
m_scene.AddSceneObject(otherSo);
|
m_scene.AddSceneObject(otherSo);
|
||||||
|
|
||||||
OSSL_Api osslApi = new OSSL_Api();
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
osslApi.Initialize(m_engine, part, null, null, null);
|
osslApi.Initialize(m_engine, part, null, null);
|
||||||
|
|
||||||
OSSL_Api otherOsslApi = new OSSL_Api();
|
OSSL_Api otherOsslApi = new OSSL_Api();
|
||||||
otherOsslApi.Initialize(m_engine, otherPart, null, null, null);
|
otherOsslApi.Initialize(m_engine, otherPart, null, null);
|
||||||
|
|
||||||
string notecardName = "appearanceNc";
|
string notecardName = "appearanceNc";
|
||||||
osslApi.osOwnerSaveAppearance(notecardName);
|
osslApi.osOwnerSaveAppearance(notecardName);
|
||||||
|
@ -332,7 +332,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests
|
||||||
m_scene.AddSceneObject(so);
|
m_scene.AddSceneObject(so);
|
||||||
|
|
||||||
OSSL_Api osslApi = new OSSL_Api();
|
OSSL_Api osslApi = new OSSL_Api();
|
||||||
osslApi.Initialize(m_engine, part, null, null, null);
|
osslApi.Initialize(m_engine, part, null, null);
|
||||||
|
|
||||||
string notecardName = "appearanceNc";
|
string notecardName = "appearanceNc";
|
||||||
osslApi.osOwnerSaveAppearance(notecardName);
|
osslApi.osOwnerSaveAppearance(notecardName);
|
||||||
|
|
Loading…
Reference in New Issue