Getting Started with Region Modules/New

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
m (Robot: Cosmetic changes)
 
Line 2: Line 2:
  
 
There's a way to do this without a Resources folder.
 
There's a way to do this without a Resources folder.
See [[New_Region_Modules]]
+
See [[New Region Modules]]
  
 
-- Update --
 
-- Update --
  
In the new version, this is a basic version of a non shared RegionModule.   For a Shared region module, replace INonSharedRegionModule with ISharedRegionModule below.
+
In the new version, this is a basic version of a non shared RegionModule. For a Shared region module, replace INonSharedRegionModule with ISharedRegionModule below.
  
 
<source lang=csharp>
 
<source lang=csharp>
Line 60: Line 60:
 
</source>
 
</source>
  
In Your Source project folder there should also be a Resources folder with a module.addins.xml like the following: (remember the Type of your module is; namespace.classname)
+
In Your Source project folder there should also be a Resources folder with a module.addins.xml like the following: (remember the Type of your module is; namespace.classname)
  
 
<source lang=ini>
 
<source lang=ini>
Line 79: Line 79:
 
</Addin>
 
</Addin>
 
</source>
 
</source>
 
  
 
[[Category:Modules]]
 
[[Category:Modules]]

Latest revision as of 20:05, 3 March 2012

-- Update --

There's a way to do this without a Resources folder. See New Region Modules

-- Update --

In the new version, this is a basic version of a non shared RegionModule. For a Shared region module, replace INonSharedRegionModule with ISharedRegionModule below.

using System;
using System.Collections.Generic;
using System.Reflection;
using log4net;
using Nini.Config;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
 
namespace YouNameSpaceHere
 
public class YourModule : INonSharedRegionModule
{
	private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
 
	public string Name
        {
            get { return "YourModuleName"; }
        }
	public Type ReplaceableInterface
        {
            get { return null; }
        }
 
	public void Initialise(IConfigSource source)
        {
	}
 
	public void Close()
        {
        }
 
        public void AddRegion(Scene scene)
        {
        }
 
        public void RemoveRegion(Scene scene)
        {
        }
 
       	public void RegionLoaded(Scene scene)
        {
	}
	public void PostInitialise()
        {
        }
 
}

In Your Source project folder there should also be a Resources folder with a module.addins.xml like the following: (remember the Type of your module is; namespace.classname)

<Addin id="YourNamespace" version="0.3">
 
    <Runtime>
        <Import assembly="YourDLL.dll"/>
    </Runtime>
 
    <Dependencies>
        <Addin id="OpenSim" version="0.5" />
    </Dependencies>
 
    <Extension path = "/OpenSim/RegionModules">
        <RegionModule id="YourModule" type="TypeOfYourModule" />    \
    </Extension>  
 
</Addin>
Personal tools
General
About This Wiki