* Applies Mantis #3630 - Adds support for outside MRM initialisation, makes MRMModule compatible with the Visual Studio MRMLoader ( http://forge.opensimulator.org/gf/project/mrmloader/ )
parent
e96071eb6e
commit
559355189a
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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);
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -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>();
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue