diff options
author | Melanie | 2009-08-07 21:30:21 +0100 |
---|---|---|
committer | Melanie | 2009-08-07 21:30:21 +0100 |
commit | ad0d2fea20217bebaeb1b1ebbae85be56d17a21d (patch) | |
tree | c7ced4700c80b9fbd15a3d26696ecda56b0ae5d3 /OpenSim | |
parent | Remove GetFullPath call from config includes, because it barfs in Windoze (diff) | |
download | opensim-SC_OLD-ad0d2fea20217bebaeb1b1ebbae85be56d17a21d.zip opensim-SC_OLD-ad0d2fea20217bebaeb1b1ebbae85be56d17a21d.tar.gz opensim-SC_OLD-ad0d2fea20217bebaeb1b1ebbae85be56d17a21d.tar.bz2 opensim-SC_OLD-ad0d2fea20217bebaeb1b1ebbae85be56d17a21d.tar.xz |
Experimental! Implement ISponsor in ScriptInstance
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 7b6b49f..4211ced 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -53,7 +53,7 @@ using OpenSim.Region.ScriptEngine.Interfaces; | |||
53 | 53 | ||
54 | namespace OpenSim.Region.ScriptEngine.Shared.Instance | 54 | namespace OpenSim.Region.ScriptEngine.Shared.Instance |
55 | { | 55 | { |
56 | public class ScriptInstance : IScriptInstance | 56 | public class ScriptInstance : MarshalByRefObject, IScriptInstance, ISponsor |
57 | { | 57 | { |
58 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 58 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
59 | 59 | ||
@@ -96,7 +96,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
96 | private string m_CurrentState = String.Empty; | 96 | private string m_CurrentState = String.Empty; |
97 | private UUID m_RegionID = UUID.Zero; | 97 | private UUID m_RegionID = UUID.Zero; |
98 | 98 | ||
99 | private ScriptSponsor m_ScriptSponsor; | ||
100 | private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> | 99 | private Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> |
101 | m_LineMap; | 100 | m_LineMap; |
102 | 101 | ||
@@ -261,9 +260,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
261 | Path.GetFileNameWithoutExtension(assembly), | 260 | Path.GetFileNameWithoutExtension(assembly), |
262 | "SecondLife.Script"); | 261 | "SecondLife.Script"); |
263 | 262 | ||
264 | m_ScriptSponsor = new ScriptSponsor(); | ||
265 | ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass); | 263 | ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass); |
266 | lease.Register(m_ScriptSponsor); | 264 | lease.Register(this); |
267 | } | 265 | } |
268 | catch (Exception) | 266 | catch (Exception) |
269 | { | 267 | { |
@@ -365,14 +363,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
365 | } | 363 | } |
366 | } | 364 | } |
367 | 365 | ||
368 | ~ScriptInstance() | ||
369 | { | ||
370 | m_Script.Close(); | ||
371 | m_ScriptSponsor.Close(); | ||
372 | ILease lease = (ILease)RemotingServices.GetLifetimeService(m_Script as ScriptBaseClass); | ||
373 | lease.Unregister(m_ScriptSponsor); | ||
374 | } | ||
375 | |||
376 | public void Init() | 366 | public void Init() |
377 | { | 367 | { |
378 | if (!m_startOnInit) return; | 368 | if (!m_startOnInit) return; |
@@ -1016,5 +1006,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
1016 | { | 1006 | { |
1017 | return true; | 1007 | return true; |
1018 | } | 1008 | } |
1009 | |||
1010 | public TimeSpan Renewal(ILease lease) | ||
1011 | { | ||
1012 | return lease.InitialLeaseTime; | ||
1013 | } | ||
1019 | } | 1014 | } |
1020 | } | 1015 | } |