From 9511a8c76370f21e839114007dcd2b25c69b009a Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Sat, 8 Nov 2008 17:35:48 +0000 Subject: Work in progress on SECS stuff. Have been holding it off until after 0.6 release. Still messy as hell and doesn't really work yet. Will undergo dramatic changes. AND MOST IMPORTANTLY: Will be conformed to work in coop with todays DNE and XEngine, hopefully one day providing a common interface for all components. --- .../ScriptEngine/Shared.Script/ICommandProvider.cs | 12 ++++++ OpenSim/ScriptEngine/Shared.Script/IScript.cs | 11 ++++++ .../Shared.Script/Properties/AssemblyInfo.cs | 36 +++++++++++++++++ OpenSim/ScriptEngine/Shared.Script/ScriptBase.cs | 45 ++++++++++++++++++++++ 4 files changed, 104 insertions(+) create mode 100644 OpenSim/ScriptEngine/Shared.Script/ICommandProvider.cs create mode 100644 OpenSim/ScriptEngine/Shared.Script/IScript.cs create mode 100644 OpenSim/ScriptEngine/Shared.Script/Properties/AssemblyInfo.cs create mode 100644 OpenSim/ScriptEngine/Shared.Script/ScriptBase.cs (limited to 'OpenSim/ScriptEngine/Shared.Script') diff --git a/OpenSim/ScriptEngine/Shared.Script/ICommandProvider.cs b/OpenSim/ScriptEngine/Shared.Script/ICommandProvider.cs new file mode 100644 index 0000000..fefb5f9 --- /dev/null +++ b/OpenSim/ScriptEngine/Shared.Script/ICommandProvider.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ScriptAssemblies +{ + public interface ICommandProvider + { + void ExecuteCommand(string functionName, params object[] args); + string Name { get; } + } +} diff --git a/OpenSim/ScriptEngine/Shared.Script/IScript.cs b/OpenSim/ScriptEngine/Shared.Script/IScript.cs new file mode 100644 index 0000000..5a3d3f3 --- /dev/null +++ b/OpenSim/ScriptEngine/Shared.Script/IScript.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace ScriptAssemblies +{ + public interface IScript + { + void ExecuteFunction(string functionName, params object[] args); + } +} \ No newline at end of file diff --git a/OpenSim/ScriptEngine/Shared.Script/Properties/AssemblyInfo.cs b/OpenSim/ScriptEngine/Shared.Script/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..96b6c0c --- /dev/null +++ b/OpenSim/ScriptEngine/Shared.Script/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("OpenSim.ScriptEngine.Shared.Script")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("OpenSim.ScriptEngine.Shared.Script")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("ea77002b-c967-4368-ace9-6533f8147d4b")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OpenSim/ScriptEngine/Shared.Script/ScriptBase.cs b/OpenSim/ScriptEngine/Shared.Script/ScriptBase.cs new file mode 100644 index 0000000..587314f --- /dev/null +++ b/OpenSim/ScriptEngine/Shared.Script/ScriptBase.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Runtime.Remoting.Lifetime; +using System.Text; + +namespace ScriptAssemblies +{ + public class ScriptBase : MarshalByRefObject, IScript + { + + #region AppDomain Serialization Keep-Alive + // + // Never expire this object + // + public override Object InitializeLifetimeService() + { + ILease lease = (ILease)base.InitializeLifetimeService(); + + if (lease.CurrentState == LeaseState.Initial) + { + lease.InitialLeaseTime = TimeSpan.Zero; + } + return lease; + } + #endregion + + public delegate void ExecuteFunctionEventDelegate(string functionName, params object[] args); + public event ExecuteFunctionEventDelegate OnExecuteFunction; + + private List CommandProviders = new List(); + + public ScriptBase() + { + } + + public void ExecuteFunction(string functionName, params object[] args) + { + // We got a new command, fire event + if (OnExecuteFunction != null) + OnExecuteFunction(functionName, args); + + } + } +} -- cgit v1.1