aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs37
1 files changed, 31 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index b5b0082..c3e4679 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -39,9 +39,12 @@ using OpenSim.Region.Framework.Interfaces;
39using OpenSim.Region.Framework.Scenes; 39using OpenSim.Region.Framework.Scenes;
40using OpenSim.Services.Interfaces; 40using OpenSim.Services.Interfaces;
41 41
42using Mono.Addins;
43
42namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory 44namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
43{ 45{
44 public class AvatarFactoryModule : IAvatarFactoryModule, IRegionModule 46 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
47 public class AvatarFactoryModule : IAvatarFactoryModule, INonSharedRegionModule
45 { 48 {
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 50
@@ -61,10 +64,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
61 64
62 #region IRegionModule 65 #region IRegionModule
63 66
64 public void Initialise(Scene scene, IConfigSource config) 67 public void Initialise(IConfigSource config)
65 { 68 {
66 scene.RegisterModuleInterface<IAvatarFactoryModule>(this);
67 scene.EventManager.OnNewClient += SubscribeToClientEvents;
68 69
69 IConfig appearanceConfig = config.Configs["Appearance"]; 70 IConfig appearanceConfig = config.Configs["Appearance"];
70 if (appearanceConfig != null) 71 if (appearanceConfig != null)
@@ -74,11 +75,29 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
74 // m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime); 75 // m_log.InfoFormat("[AVFACTORY] configured for {0} save and {1} send",m_savetime,m_sendtime);
75 } 76 }
76 77
78 }
79
80 public void AddRegion(Scene scene)
81 {
77 if (m_scene == null) 82 if (m_scene == null)
78 m_scene = scene; 83 m_scene = scene;
84
85 scene.RegisterModuleInterface<IAvatarFactoryModule>(this);
86 scene.EventManager.OnNewClient += SubscribeToClientEvents;
79 } 87 }
80 88
81 public void PostInitialise() 89 public void RemoveRegion(Scene scene)
90 {
91 if (scene == m_scene)
92 {
93 scene.UnregisterModuleInterface<IAvatarFactoryModule>(this);
94 scene.EventManager.OnNewClient -= SubscribeToClientEvents;
95 }
96
97 m_scene = null;
98 }
99
100 public void RegionLoaded(Scene scene)
82 { 101 {
83 m_updateTimer.Enabled = false; 102 m_updateTimer.Enabled = false;
84 m_updateTimer.AutoReset = true; 103 m_updateTimer.AutoReset = true;
@@ -100,6 +119,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
100 get { return false; } 119 get { return false; }
101 } 120 }
102 121
122 public Type ReplaceableInterface
123 {
124 get { return null; }
125 }
126
127
103 private void SubscribeToClientEvents(IClientAPI client) 128 private void SubscribeToClientEvents(IClientAPI client)
104 { 129 {
105 client.OnRequestWearables += Client_OnRequestWearables; 130 client.OnRequestWearables += Client_OnRequestWearables;