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="VivoxVoice" type="OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice.VivoxVoiceModule" />
<RegionModule id="WorldViewModule" type="OpenSim.Region.OptionalModules.World.WorldView.WorldViewModule" /> <RegionModule id="WorldViewModule" type="OpenSim.Region.OptionalModules.World.WorldView.WorldViewModule" />
<RegionModule id="AutoBackupModule" type="OpenSim.Region.OptionalModules.World.AutoBackup.AutoBackupModule" /> <RegionModule id="AutoBackupModule" type="OpenSim.Region.OptionalModules.World.AutoBackup.AutoBackupModule" />
<RegionModule id="TreePopulatorModule" type="OpenSim.Region.OptionalModules.World.TreePopulator.TreePopulatorModule" />
</Extension> </Extension>
</Addin> </Addin>

View File

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