diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Host.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Host.cs index 5a3690f0ef..394e02410c 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Host.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Host.cs @@ -25,10 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -using System; -using System.Collections.Generic; using System.Reflection; -using System.Text; using log4net; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/IPersistence.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IPersistence.cs new file mode 100644 index 0000000000..6020a7a281 --- /dev/null +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/IPersistence.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace OpenSim.Region.OptionalModules.Scripting.Minimodule +{ + interface IPersistence + { + Object Get(MRMBase state, Guid storageID); + Object Get(MRMBase state); + + /// + /// Stores 'data' into the persistence system + /// associated with this object, however saved + /// under the ID 'storageID'. This data may + /// be accessed by other scripts however. + /// + /// + /// + /// + void Put(MRMBase state, Guid storageID, Object data); + + /// + /// Stores 'data' into the persistence system + /// using the default ID for this script. + /// + /// + /// + void Put(MRMBase state, Object data); + } +} diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMBase.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMBase.cs index b98bb9583b..c47e592b5c 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMBase.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMBase.cs @@ -25,17 +25,21 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using OpenMetaverse; + namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { public abstract class MRMBase { private IWorld m_world; private IHost m_host; + private UUID m_id; - public void InitMiniModule(IWorld world, IHost host) + public void InitMiniModule(IWorld world, IHost host, UUID uniqueID) { m_world = world; m_host = host; + m_id = uniqueID; } protected IWorld World @@ -48,6 +52,11 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule get { return m_host; } } + public UUID ID + { + get { return m_id; } + } + public abstract void Start(); public abstract void Stop(); } diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs index 7c877564da..3e53bc5780 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/MRMModule.cs @@ -82,7 +82,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule CompileFromDotNetText(script, itemID.ToString()), "OpenSim.MiniModule"); m_log.Info("[MRM] Created MRM Instance"); - mmb.InitMiniModule(m_world, m_host); + mmb.InitMiniModule(m_world, m_host, itemID); m_scripts[itemID] = mmb; m_log.Info("[MRM] Starting MRM"); diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index 8b7b470197..5010a34279 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs @@ -1,11 +1,12 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { - class SOPObject : IObject + class SOPObject : MarshalByRefObject, IObject { private readonly Scene m_rootScene; private readonly uint m_localID;