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 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); 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 protected Dictionary<UUID, Dictionary<ulong, string>> childrenSeeds
= new Dictionary<UUID, Dictionary<ulong, string>>(); = 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 = scene;
m_scene.RegisterModuleInterface<ICapabilitiesModule>(this); 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 PostInitialise() {}
public void Close() {} 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) public void AddCapsHandler(UUID agentId)
{ {
@ -86,7 +103,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
Caps caps Caps caps
= new 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, m_scene.CommsManager.HttpServer.Port,
capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName); capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName);

View File

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

View File

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