diff options
author | Tedd Hansen | 2008-11-08 17:35:48 +0000 |
---|---|---|
committer | Tedd Hansen | 2008-11-08 17:35:48 +0000 |
commit | 9511a8c76370f21e839114007dcd2b25c69b009a (patch) | |
tree | b63323dfd96ecd1cc3cd560939bd66bb43ec9c1c /OpenSim/ScriptEngine/Shared.Script/ScriptBase.cs | |
parent | * Added IClientIM to IClientCore interfaces (diff) | |
download | opensim-SC_OLD-9511a8c76370f21e839114007dcd2b25c69b009a.zip opensim-SC_OLD-9511a8c76370f21e839114007dcd2b25c69b009a.tar.gz opensim-SC_OLD-9511a8c76370f21e839114007dcd2b25c69b009a.tar.bz2 opensim-SC_OLD-9511a8c76370f21e839114007dcd2b25c69b009a.tar.xz |
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.
Diffstat (limited to 'OpenSim/ScriptEngine/Shared.Script/ScriptBase.cs')
-rw-r--r-- | OpenSim/ScriptEngine/Shared.Script/ScriptBase.cs | 45 |
1 files changed, 45 insertions, 0 deletions
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 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Reflection; | ||
4 | using System.Runtime.Remoting.Lifetime; | ||
5 | using System.Text; | ||
6 | |||
7 | namespace ScriptAssemblies | ||
8 | { | ||
9 | public class ScriptBase : MarshalByRefObject, IScript | ||
10 | { | ||
11 | |||
12 | #region AppDomain Serialization Keep-Alive | ||
13 | // | ||
14 | // Never expire this object | ||
15 | // | ||
16 | public override Object InitializeLifetimeService() | ||
17 | { | ||
18 | ILease lease = (ILease)base.InitializeLifetimeService(); | ||
19 | |||
20 | if (lease.CurrentState == LeaseState.Initial) | ||
21 | { | ||
22 | lease.InitialLeaseTime = TimeSpan.Zero; | ||
23 | } | ||
24 | return lease; | ||
25 | } | ||
26 | #endregion | ||
27 | |||
28 | public delegate void ExecuteFunctionEventDelegate(string functionName, params object[] args); | ||
29 | public event ExecuteFunctionEventDelegate OnExecuteFunction; | ||
30 | |||
31 | private List<ICommandProvider> CommandProviders = new List<ICommandProvider>(); | ||
32 | |||
33 | public ScriptBase() | ||
34 | { | ||
35 | } | ||
36 | |||
37 | public void ExecuteFunction(string functionName, params object[] args) | ||
38 | { | ||
39 | // We got a new command, fire event | ||
40 | if (OnExecuteFunction != null) | ||
41 | OnExecuteFunction(functionName, args); | ||
42 | |||
43 | } | ||
44 | } | ||
45 | } | ||