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. --- OpenSim/ScriptEngine/Shared.Script/ScriptBase.cs | 45 ++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 OpenSim/ScriptEngine/Shared.Script/ScriptBase.cs (limited to 'OpenSim/ScriptEngine/Shared.Script/ScriptBase.cs') 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