One more module converted: TreePopulator.

integration
Diva Canto 2012-11-09 22:09:08 -08:00
parent bbff036944
commit a4fee98352
2 changed files with 20 additions and 11 deletions

View File

@ -14,5 +14,6 @@
<RegionModule id="VivoxVoice" type="OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice.VivoxVoiceModule" />
<RegionModule id="WorldViewModule" type="OpenSim.Region.OptionalModules.World.WorldView.WorldViewModule" />
<RegionModule id="AutoBackupModule" type="OpenSim.Region.OptionalModules.World.AutoBackup.AutoBackupModule" />
<RegionModule id="TreePopulatorModule" type="OpenSim.Region.OptionalModules.World.TreePopulator.TreePopulatorModule" />
</Extension>
</Addin>

View File

@ -46,7 +46,7 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
/// <summary>
/// Version 2.02 - Still hacky
/// </summary>
public class TreePopulatorModule : IRegionModule, ICommandableModule, IVegetationModule
public class TreePopulatorModule : INonSharedRegionModule, ICommandableModule, IVegetationModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private readonly Commander m_commander = new Commander("tree");
@ -170,13 +170,9 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
#region IRegionModule Members
public void Initialise(Scene scene, IConfigSource config)
public void Initialise(IConfigSource config)
{
m_scene = scene;
m_scene.RegisterModuleInterface<IRegionModule>(this);
m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
// ini file settings
try
{
@ -201,7 +197,20 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
m_log.Debug("[TREES]: Initialised tree module");
}
public void PostInitialise()
public void AddRegion(Scene scene)
{
m_scene = scene;
//m_scene.RegisterModuleInterface<IRegionModule>(this);
m_scene.RegisterModuleCommander(m_commander);
m_scene.EventManager.OnPluginConsole += EventManager_OnPluginConsole;
}
public void RemoveRegion(Scene scene)
{
}
public void RegionLoaded(Scene scene)
{
ReloadCopse();
if (m_copse.Count > 0)
@ -220,11 +229,12 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
get { return "TreePopulatorModule"; }
}
public bool IsSharedModule
public Type ReplaceableInterface
{
get { return false; }
get { return null; }
}
#endregion
//--------------------------------------------------------------
@ -448,8 +458,6 @@ namespace OpenSim.Region.OptionalModules.World.TreePopulator
m_commander.RegisterCommand("reload", treeReloadCommand);
m_commander.RegisterCommand("remove", treeRemoveCommand);
m_commander.RegisterCommand("statistics", treeStatisticsCommand);
m_scene.RegisterModuleCommander(m_commander);
}
/// <summary>