aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs25
1 files changed, 9 insertions, 16 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
index d119a77..964fe4c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
@@ -26,7 +26,6 @@
26 */ 26 */
27 27
28using System; 28using System;
29using System.Runtime.Remoting;
30using System.Runtime.Remoting.Lifetime; 29using System.Runtime.Remoting.Lifetime;
31using System.Security.Permissions; 30using System.Security.Permissions;
32using System.Threading; 31using System.Threading;
@@ -35,23 +34,26 @@ using System.Collections;
35using System.Collections.Generic; 34using System.Collections.Generic;
36using OpenSim.Region.ScriptEngine.Interfaces; 35using OpenSim.Region.ScriptEngine.Interfaces;
37using OpenSim.Region.ScriptEngine.Shared; 36using OpenSim.Region.ScriptEngine.Shared;
38using OpenSim.Region.ScriptEngine.Shared.Api.Runtime;
39 37
40namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase 38namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
41{ 39{
42 public partial class ScriptBaseClass : MarshalByRefObject, IScript 40 public partial class ScriptBaseClass : MarshalByRefObject, IScript
43 { 41 {
44 private Dictionary<string, MethodInfo> inits = new Dictionary<string, MethodInfo>(); 42 private Dictionary<string, MethodInfo> inits = new Dictionary<string, MethodInfo>();
45 private ScriptSponsor m_sponser;
46 43
44 // Object expires if we don't keep it alive
45 // sponsor will be added on object load
46 [SecurityPermissionAttribute(SecurityAction.Demand,
47 Flags = SecurityPermissionFlag.Infrastructure)]
47 public override Object InitializeLifetimeService() 48 public override Object InitializeLifetimeService()
48 { 49 {
49 ILease lease = (ILease)base.InitializeLifetimeService(); 50 ILease lease = (ILease)base.InitializeLifetimeService();
50 if (lease.CurrentState == LeaseState.Initial) 51 if (lease.CurrentState == LeaseState.Initial)
51 { 52 {
52 lease.InitialLeaseTime = TimeSpan.FromMinutes(1.0); 53 lease.InitialLeaseTime = TimeSpan.Zero;
53 lease.RenewOnCallTime = TimeSpan.FromSeconds(10.0); 54// lease.InitialLeaseTime = TimeSpan.FromMinutes(1);
54 lease.SponsorshipTimeout = TimeSpan.FromMinutes(1.0); 55// lease.SponsorshipTimeout = TimeSpan.FromMinutes(2);
56// lease.RenewOnCallTime = TimeSpan.FromSeconds(2);
55 } 57 }
56 return lease; 58 return lease;
57 } 59 }
@@ -64,6 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
64 } 66 }
65#endif 67#endif
66 68
69
67 public ScriptBaseClass() 70 public ScriptBaseClass()
68 { 71 {
69 m_Executor = new Executor(this); 72 m_Executor = new Executor(this);
@@ -78,8 +81,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
78 inits[type] = mi; 81 inits[type] = mi;
79 } 82 }
80 } 83 }
81
82 m_sponser = new ScriptSponsor();
83 } 84 }
84 85
85 private Executor m_Executor = null; 86 private Executor m_Executor = null;
@@ -111,9 +112,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
111 if (!inits.ContainsKey(api)) 112 if (!inits.ContainsKey(api))
112 return; 113 return;
113 114
114 ILease lease = (ILease)RemotingServices.GetLifetimeService(data as MarshalByRefObject);
115 lease.Register(m_sponser);
116
117 MethodInfo mi = inits[api]; 115 MethodInfo mi = inits[api];
118 116
119 Object[] args = new Object[1]; 117 Object[] args = new Object[1];
@@ -124,11 +122,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
124 m_InitialValues = GetVars(); 122 m_InitialValues = GetVars();
125 } 123 }
126 124
127 public void Close()
128 {
129 m_sponser.Close();
130 }
131
132 public Dictionary<string, object> GetVars() 125 public Dictionary<string, object> GetVars()
133 { 126 {
134 Dictionary<string, object> vars = new Dictionary<string, object>(); 127 Dictionary<string, object> vars = new Dictionary<string, object>();