One more module converted: AvatarFactoryModule.
parent
5fb5758103
commit
74dd38db70
|
@ -39,9 +39,12 @@ using OpenSim.Region.Framework.Interfaces;
|
||||||
using OpenSim.Region.Framework.Scenes;
|
using OpenSim.Region.Framework.Scenes;
|
||||||
using OpenSim.Services.Interfaces;
|
using OpenSim.Services.Interfaces;
|
||||||
|
|
||||||
|
using Mono.Addins;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
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);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
|
@ -61,10 +64,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
|
|
||||||
#region IRegionModule
|
#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"];
|
IConfig appearanceConfig = config.Configs["Appearance"];
|
||||||
if (appearanceConfig != null)
|
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);
|
// 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.Enabled = false;
|
||||||
m_updateTimer.AutoReset = true;
|
m_updateTimer.AutoReset = true;
|
||||||
|
@ -100,6 +119,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
get { return false; }
|
get { return false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Type ReplaceableInterface
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void SubscribeToClientEvents(IClientAPI client)
|
private void SubscribeToClientEvents(IClientAPI client)
|
||||||
{
|
{
|
||||||
client.OnRequestWearables += Client_OnRequestWearables;
|
client.OnRequestWearables += Client_OnRequestWearables;
|
||||||
|
|
Loading…
Reference in New Issue