From 559355189af9432b01eef00c76071dee684a6cc0 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Tue, 12 May 2009 13:10:04 +0000 Subject: * Applies Mantis #3630 - Adds support for outside MRM initialisation, makes MRMModule compatible with the Visual Studio MRMLoader ( http://forge.opensimulator.org/gf/project/mrmloader/ ) --- .../Scripting/Minimodule/Graphics.cs | 2 +- .../Scripting/Minimodule/Heightmap.cs | 2 +- .../OptionalModules/Scripting/Minimodule/Host.cs | 2 +- .../Scripting/Minimodule/IMRMModule.cs | 5 ++++- .../Scripting/Minimodule/LOParcel.cs | 2 +- .../OptionalModules/Scripting/Minimodule/MRMBase.cs | 2 +- .../Scripting/Minimodule/MRMModule.cs | 21 ++++++++++++++++----- .../Scripting/Minimodule/MicroScheduler.cs | 2 +- .../Scripting/Minimodule/ObjectAccessor.cs | 4 ++-- .../OptionalModules/Scripting/Minimodule/SEUser.cs | 2 +- .../Scripting/Minimodule/SOPObjectMaterial.cs | 2 +- .../Scripting/Minimodule/SPAvatar.cs | 2 +- .../OptionalModules/Scripting/Minimodule/World.cs | 2 +- 13 files changed, 32 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Scripting') diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Graphics.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Graphics.cs index 50e6f6c..0b937c1 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Graphics.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Graphics.cs @@ -33,7 +33,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { - class Graphics : IGraphics + class Graphics : System.MarshalByRefObject, IGraphics { private readonly Scene m_scene; diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Heightmap.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Heightmap.cs index 9b9d686..47c3085 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Heightmap.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Heightmap.cs @@ -29,7 +29,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { - public class Heightmap : IHeightmap + public class Heightmap : System.MarshalByRefObject, IHeightmap { private readonly Scene m_scene; diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Host.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Host.cs index 193461d..cbde283 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Host.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Host.cs @@ -32,7 +32,7 @@ using OpenSim.Region.OptionalModules.Scripting.Minimodule.Interfaces; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { - class Host : IHost + class Host : System.MarshalByRefObject, IHost { private readonly IObject m_obj; private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IMRMModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IMRMModule.cs index 486d0d9..9f48081 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IMRMModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IMRMModule.cs @@ -25,10 +25,13 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using OpenMetaverse; + namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { public interface IMRMModule { void RegisterExtension(T instance); + void InitializeMRM(MRMBase mmb, uint localID, UUID itemID); } -} \ No newline at end of file +} diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs index d2f3121..37c7434 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/LOParcel.cs @@ -30,7 +30,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { - class LOParcel : IParcel + class LOParcel : System.MarshalByRefObject, IParcel { private readonly Scene m_scene; private readonly int m_parcelID; diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMBase.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMBase.cs index c47e592..6a23f5d 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMBase.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMBase.cs @@ -29,7 +29,7 @@ using OpenMetaverse; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { - public abstract class MRMBase + public abstract class MRMBase : System.MarshalByRefObject { private IWorld m_world; private IHost m_host; diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs index 3a6b1b1..e0b6150 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs @@ -108,15 +108,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule try { m_log.Info("[MRM] Found C# MRM"); - IWorld m_world = new World(m_scene); - IHost m_host = new Host(new SOPObject(m_scene, localID), m_scene, new ExtensionHandler(m_extensions), - m_microthreads); MRMBase mmb = (MRMBase)AppDomain.CurrentDomain.CreateInstanceFromAndUnwrap( CompileFromDotNetText(script, itemID.ToString()), "OpenSim.MiniModule"); - m_log.Info("[MRM] Created MRM Instance"); - mmb.InitMiniModule(m_world, m_host, itemID); + + InitializeMRM(mmb, localID, itemID); + m_scripts[itemID] = mmb; m_log.Info("[MRM] Starting MRM"); @@ -148,6 +146,19 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule } } + public void InitializeMRM(MRMBase mmb, uint localID, UUID itemID) + { + + m_log.Info("[MRM] Created MRM Instance"); + + IWorld m_world = new World(m_scene); + IHost m_host = new Host(new SOPObject(m_scene, localID), m_scene, new ExtensionHandler(m_extensions), + m_microthreads); + + mmb.InitMiniModule(m_world, m_host, itemID); + + } + public void PostInitialise() { diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MicroScheduler.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MicroScheduler.cs index aaa2848..73fe8b8 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MicroScheduler.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MicroScheduler.cs @@ -35,7 +35,7 @@ using OpenSim.Region.OptionalModules.Scripting.Minimodule.Interfaces; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { - public class MicroScheduler : IMicrothreader + public class MicroScheduler : System.MarshalByRefObject, IMicrothreader { private readonly List m_threads = new List(); diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs index 2bd2e29..a64a1c2 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/ObjectAccessor.cs @@ -35,7 +35,7 @@ using IEnumerable=System.Collections.IEnumerable; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { - internal class IObjEnum : IEnumerator + internal class IObjEnum : System.MarshalByRefObject, IEnumerator { private readonly Scene m_scene; private readonly IEnumerator m_sogEnum; @@ -75,7 +75,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule } } - public class ObjectAccessor : IObjectAccessor + public class ObjectAccessor : System.MarshalByRefObject, IObjectAccessor { private readonly Scene m_scene; diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SEUser.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SEUser.cs index ebf68b1..e2bdf5e 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SEUser.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SEUser.cs @@ -32,7 +32,7 @@ using OpenMetaverse; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { - class SEUser : ISocialEntity + class SEUser : System.MarshalByRefObject, ISocialEntity { private readonly UUID m_uuid; private readonly string m_name; diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectMaterial.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectMaterial.cs index e6b99be..68f2f52 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectMaterial.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObjectMaterial.cs @@ -31,7 +31,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { - class SOPObjectMaterial : IObjectMaterial + class SOPObjectMaterial : System.MarshalByRefObject, IObjectMaterial { private readonly int m_face; private readonly SceneObjectPart m_parent; diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs index 41074c3..0f2076e 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SPAvatar.cs @@ -31,7 +31,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { - class SPAvatar : IAvatar + class SPAvatar : System.MarshalByRefObject, IAvatar { private readonly Scene m_rootScene; private readonly UUID m_ID; diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs index cbbe86d..dc80dcc 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs @@ -32,7 +32,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { - public class World : IWorld + public class World : System.MarshalByRefObject, IWorld { private readonly Scene m_internalScene; private readonly Heightmap m_heights; -- cgit v1.1