Getting Started with Region Modules/New
From OpenSimulator
(Difference between revisions)
(more help parts to make this make a bit more sense) |
m (Robot: Cosmetic changes) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | In the new version, this is a basic version of a RegionModule | + | -- 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. | ||
<source lang=csharp> | <source lang=csharp> | ||
Line 53: | Line 60: | ||
</source> | </source> | ||
− | In Your Source project folder there should also be a Resources folder with a module.addins.xml like the following: | + | 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 72: | Line 79: | ||
</Addin> | </Addin> | ||
</source> | </source> | ||
+ | |||
+ | [[Category:Modules]] |
Latest revision as of 19: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>