* Applies Mantis #3630 - Adds support for outside MRM initialisation, makes MRMModule compatible with the Visual Studio MRMLoader ( http://forge.opensimulator.org/gf/project/mrmloader/ )

0.6.5-rc1
Adam Frisby 2009-05-12 13:10:04 +00:00
parent e96071eb6e
commit 559355189a
13 changed files with 32 additions and 18 deletions

View File

@ -33,7 +33,7 @@ using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
class Graphics : IGraphics class Graphics : System.MarshalByRefObject, IGraphics
{ {
private readonly Scene m_scene; private readonly Scene m_scene;

View File

@ -29,7 +29,7 @@ using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
public class Heightmap : IHeightmap public class Heightmap : System.MarshalByRefObject, IHeightmap
{ {
private readonly Scene m_scene; private readonly Scene m_scene;

View File

@ -32,7 +32,7 @@ using OpenSim.Region.OptionalModules.Scripting.Minimodule.Interfaces;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
class Host : IHost class Host : System.MarshalByRefObject, IHost
{ {
private readonly IObject m_obj; private readonly IObject m_obj;
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

View File

@ -25,10 +25,13 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
using OpenMetaverse;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
public interface IMRMModule public interface IMRMModule
{ {
void RegisterExtension<T>(T instance); void RegisterExtension<T>(T instance);
void InitializeMRM(MRMBase mmb, uint localID, UUID itemID);
} }
} }

View File

@ -30,7 +30,7 @@ using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
class LOParcel : IParcel class LOParcel : System.MarshalByRefObject, IParcel
{ {
private readonly Scene m_scene; private readonly Scene m_scene;
private readonly int m_parcelID; private readonly int m_parcelID;

View File

@ -29,7 +29,7 @@ using OpenMetaverse;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
public abstract class MRMBase public abstract class MRMBase : System.MarshalByRefObject
{ {
private IWorld m_world; private IWorld m_world;
private IHost m_host; private IHost m_host;

View File

@ -108,15 +108,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
try try
{ {
m_log.Info("[MRM] Found C# MRM"); 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( MRMBase mmb = (MRMBase)AppDomain.CurrentDomain.CreateInstanceFromAndUnwrap(
CompileFromDotNetText(script, itemID.ToString()), CompileFromDotNetText(script, itemID.ToString()),
"OpenSim.MiniModule"); "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_scripts[itemID] = mmb;
m_log.Info("[MRM] Starting MRM"); 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() public void PostInitialise()
{ {

View File

@ -35,7 +35,7 @@ using OpenSim.Region.OptionalModules.Scripting.Minimodule.Interfaces;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
public class MicroScheduler : IMicrothreader public class MicroScheduler : System.MarshalByRefObject, IMicrothreader
{ {
private readonly List<IEnumerator> m_threads = new List<IEnumerator>(); private readonly List<IEnumerator> m_threads = new List<IEnumerator>();

View File

@ -35,7 +35,7 @@ using IEnumerable=System.Collections.IEnumerable;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
internal class IObjEnum : IEnumerator<IObject> internal class IObjEnum : System.MarshalByRefObject, IEnumerator<IObject>
{ {
private readonly Scene m_scene; private readonly Scene m_scene;
private readonly IEnumerator<EntityBase> m_sogEnum; private readonly IEnumerator<EntityBase> 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; private readonly Scene m_scene;

View File

@ -32,7 +32,7 @@ using OpenMetaverse;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
class SEUser : ISocialEntity class SEUser : System.MarshalByRefObject, ISocialEntity
{ {
private readonly UUID m_uuid; private readonly UUID m_uuid;
private readonly string m_name; private readonly string m_name;

View File

@ -31,7 +31,7 @@ using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
class SOPObjectMaterial : IObjectMaterial class SOPObjectMaterial : System.MarshalByRefObject, IObjectMaterial
{ {
private readonly int m_face; private readonly int m_face;
private readonly SceneObjectPart m_parent; private readonly SceneObjectPart m_parent;

View File

@ -31,7 +31,7 @@ using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
class SPAvatar : IAvatar class SPAvatar : System.MarshalByRefObject, IAvatar
{ {
private readonly Scene m_rootScene; private readonly Scene m_rootScene;
private readonly UUID m_ID; private readonly UUID m_ID;

View File

@ -32,7 +32,7 @@ using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.OptionalModules.Scripting.Minimodule namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
{ {
public class World : IWorld public class World : System.MarshalByRefObject, IWorld
{ {
private readonly Scene m_internalScene; private readonly Scene m_internalScene;
private readonly Heightmap m_heights; private readonly Heightmap m_heights;