From 3219e648ccee074e28135430afe2d26a7cf53c9e Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 7 Aug 2009 19:04:20 +0100 Subject: [PATCH] From: Snowcrash Date: Wed, 5 Aug 2009 12:45:56 +0200 Subject: [PATCH] A few minor tweaks to the MRM API's in order to make it possible for MRM's to run in a separate AppDomain without poluting the primary appdomain of OpenSim Specifically: Added an explicit method for getting the "globals" of the MRM, removing the need to have the MRM script code loaded into the primary domain, in order to set up proxies Added a [Serializable] attribute to TouchEventArgs, again in order to remove the need to have MRM script code loaded into the primary domain. --------- Applied with whitespace changes --- .../Scripting/Minimodule/IMRMModule.cs | 1 + .../Scripting/Minimodule/Interfaces/IObject.cs | 1 + .../Scripting/Minimodule/MRMModule.cs | 15 +++++++++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IMRMModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IMRMModule.cs index 9f48081dea..e957a62119 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IMRMModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IMRMModule.cs @@ -33,5 +33,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { void RegisterExtension(T instance); void InitializeMRM(MRMBase mmb, uint localID, UUID itemID); + void GetGlobalEnvironment(uint localID, out IWorld world, out IHost host); } } diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs index f45df484d8..64152505c3 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs @@ -32,6 +32,7 @@ using OpenSim.Region.OptionalModules.Scripting.Minimodule.Object; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { + [Serializable] public class TouchEventArgs : EventArgs { public IAvatar Avatar; diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs index eb807f262c..6a15a3314f 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs @@ -164,16 +164,23 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule } } + public void GetGlobalEnvironment(uint localID, out IWorld world, out IHost host) + { + world = new World(m_scene); + host = new Host(new SOPObject(m_scene, localID), m_scene, new ExtensionHandler(m_extensions), m_microthreads); + } + 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); + IWorld world; + IHost host; - mmb.InitMiniModule(m_world, m_host, itemID); + GetGlobalEnvironment(localID, out world, out host); + + mmb.InitMiniModule(world, host, itemID); } public void PostInitialise()