Getting Started with Region Modules/New
From OpenSimulator
(Difference between revisions)
(New page: In the new version, this is a basic version of a RegionModule <source lang=csharp> using System; using System.Collections.Generic; using System.Reflection; using log4net; using OpenMetave...) |
(Fixing an inaccuracy in my example) |
||
Line 6: | Line 6: | ||
using System.Reflection; | using System.Reflection; | ||
using log4net; | using log4net; | ||
+ | using Nini.Config; | ||
using OpenMetaverse; | using OpenMetaverse; | ||
using OpenSim.Framework; | using OpenSim.Framework; | ||
Line 65: | Line 66: | ||
</Dependencies> | </Dependencies> | ||
− | <Extension path = " | + | <Extension path = "/OpenSim/RegionModules"> |
<RegionModule id="YourModule" type="TypeOfYourModule" /> \ | <RegionModule id="YourModule" type="TypeOfYourModule" /> \ | ||
</Extension> | </Extension> |
Revision as of 14:05, 24 September 2009
In the new version, this is a basic version of a RegionModule
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 the Resources:
<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>