From fccb03227e3f541a4c2f4e0e619074e4c1fb55dd Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 15 Jan 2013 21:13:22 +0000 Subject: Instead of passing separate engine, part and item components to script APIs, pass down IScriptInstance instead. This is to allow the future co-operative script thread terminate feature to detect and act upon termination requests. This splits the assembly and state loading out from the ScriptInstance() constructor to a separate Load() method in order to facilititate continued script logic regression testing. --- OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs | 10 ++++------ OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs | 12 ++++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Interfaces') diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs index 2027ca6..e95cbd7 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs @@ -29,6 +29,7 @@ using System; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; +using OpenSim.Region.ScriptEngine.Shared; namespace OpenSim.Region.ScriptEngine.Interfaces { @@ -38,11 +39,8 @@ namespace OpenSim.Region.ScriptEngine.Interfaces /// Initialize the API /// /// - /// Each API has an identifier, which is used to load the - /// proper runtime assembly at load time. - /// /param> - /// - /// - void Initialize(IScriptEngine engine, SceneObjectPart part, TaskInventoryItem item); + /// Each API has an identifier, which is used to load the proper runtime assembly at load time. + /// /param> + void Initialize(IScriptInstance scriptInstance); } } \ No newline at end of file diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs index 2f5b526..9de2d72 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using OpenMetaverse; using log4net; using OpenSim.Framework; +using OpenSim.Region.Framework.Scenes; using OpenSim.Region.ScriptEngine.Shared; using OpenSim.Region.ScriptEngine.Interfaces; @@ -105,6 +106,11 @@ namespace OpenSim.Region.ScriptEngine.Interfaces /// long MeasurementPeriodExecutionTime { get; } + /// + /// Scene part in which this script instance is contained. + /// + SceneObjectPart Part { get; } + IScriptEngine Engine { get; } UUID AppDomain { get; set; } string PrimName { get; } @@ -124,6 +130,12 @@ namespace OpenSim.Region.ScriptEngine.Interfaces uint LocalID { get; } UUID AssetID { get; } + + /// + /// Inventory item containing the script used. + /// + TaskInventoryItem ScriptTask { get; } + Queue EventQueue { get; } /// -- cgit v1.1