converting CapabilitiesModule to new region module scheme

0.6.6-post-fixes
Dr Scofield 2009-05-25 11:11:04 +00:00
parent 7929970257
commit d4d9d8ed8f
3 changed files with 27 additions and 8 deletions

View File

@ -38,7 +38,7 @@ using Caps=OpenSim.Framework.Communications.Capabilities.Caps;
namespace OpenSim.Region.CoreModules.Agent.Capabilities
{
public class CapabilitiesModule : IRegionModule, ICapabilitiesModule
public class CapabilitiesModule : INonSharedRegionModule, ICapabilitiesModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -53,16 +53,33 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
protected Dictionary<UUID, Dictionary<ulong, string>> childrenSeeds
= new Dictionary<UUID, Dictionary<ulong, string>>();
public void Initialise(Scene scene, IConfigSource source)
public void Initialise(IConfigSource source)
{
}
public void AddRegion(Scene scene)
{
m_scene = scene;
m_scene.RegisterModuleInterface<ICapabilitiesModule>(this);
}
public void RegionLoaded(Scene scene)
{
}
public void RemoveRegion(Scene scene)
{
m_scene.UnregisterModuleInterface<ICapabilitiesModule>(this);
}
public void PostInitialise() {}
public void Close() {}
public string Name { get { return "Capabilities Module"; } }
public bool IsSharedModule { get { return false; } }
public string Name
{
get { return "Capabilities Module"; }
}
public void AddCapsHandler(UUID agentId)
{
@ -86,7 +103,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
Caps caps
= new Caps(
m_scene.AssetService, m_scene.CommsManager.HttpServer, m_scene.RegionInfo.ExternalHostName,
m_scene.AssetService, m_scene.CommsManager.HttpServer, m_scene.RegionInfo.ExternalHostName,
m_scene.CommsManager.HttpServer.Port,
capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName);

View File

@ -8,6 +8,7 @@
</Dependencies>
<Extension path = "/OpenSim/RegionModules">
<RegionModule id="CapabilitiesModule" type="OpenSim.Region.CoreModules.Agent.Capability.CapabilitiesModule" />
<RegionModule id="TerrainModule" type="OpenSim.Region.CoreModules.World.Terrain.TerrainModule" />
<RegionModule id="WorldMapModule" type="OpenSim.Region.CoreModules.World.WorldMap.WorldMapModule" />
<RegionModule id="HGWorldMapModule" type="OpenSim.Region.CoreModules.Hypergrid.HGWorldMapModule" />

View File

@ -117,9 +117,10 @@ namespace OpenSim.Tests.Common.Setup
TestScene testScene = new TestScene(
regInfo, acm, cm, scs, sm, null, false, false, false, configSource, null);
IRegionModule capsModule = new CapabilitiesModule();
capsModule.Initialise(testScene, new IniConfigSource());
testScene.AddModule(capsModule.Name, capsModule);
INonSharedRegionModule capsModule = new CapabilitiesModule();
capsModule.Initialise(new IniConfigSource());
testScene.AddRegionModule(capsModule.Name, capsModule);
capsModule.AddRegion(testScene);
IRegionModule godsModule = new GodsModule();
godsModule.Initialise(testScene, new IniConfigSource());