One more module converted: AvatarFactoryModule.

integration
Diva Canto 2012-11-10 16:24:15 -08:00
parent 5fb5758103
commit 74dd38db70
1 changed files with 32 additions and 7 deletions

View File

@ -39,9 +39,12 @@ using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces;
using Mono.Addins;
namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
{
public class AvatarFactoryModule : IAvatarFactoryModule, IRegionModule
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class AvatarFactoryModule : IAvatarFactoryModule, INonSharedRegionModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@ -61,10 +64,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
#region IRegionModule
public void Initialise(Scene scene, IConfigSource config)
public void Initialise(IConfigSource config)
{
scene.RegisterModuleInterface<IAvatarFactoryModule>(this);
scene.EventManager.OnNewClient += SubscribeToClientEvents;
IConfig appearanceConfig = config.Configs["Appearance"];
if (appearanceConfig != null)
@ -74,11 +75,29 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
// m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime);
}
if (m_scene == null)
m_scene = scene;
}
public void PostInitialise()
public void AddRegion(Scene scene)
{
if (m_scene == null)
m_scene = scene;
scene.RegisterModuleInterface<IAvatarFactoryModule>(this);
scene.EventManager.OnNewClient += SubscribeToClientEvents;
}
public void RemoveRegion(Scene scene)
{
if (scene == m_scene)
{
scene.UnregisterModuleInterface<IAvatarFactoryModule>(this);
scene.EventManager.OnNewClient -= SubscribeToClientEvents;
}
m_scene = null;
}
public void RegionLoaded(Scene scene)
{
m_updateTimer.Enabled = false;
m_updateTimer.AutoReset = true;
@ -100,6 +119,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
get { return false; }
}
public Type ReplaceableInterface
{
get { return null; }
}
private void SubscribeToClientEvents(IClientAPI client)
{
client.OnRequestWearables += Client_OnRequestWearables;