diff options
author | Diva Canto | 2012-11-10 16:24:15 -0800 |
---|---|---|
committer | Diva Canto | 2012-11-10 16:24:15 -0800 |
commit | 74dd38db70e88c5bf771774b6cc2ec80ab2ba215 (patch) | |
tree | 1bcba82f1d79b4cc7bc5f8dff92fbd73e02650ad | |
parent | Cleaning up some confusion with Addin names introduced in a prior commit. Als... (diff) | |
download | opensim-SC_OLD-74dd38db70e88c5bf771774b6cc2ec80ab2ba215.zip opensim-SC_OLD-74dd38db70e88c5bf771774b6cc2ec80ab2ba215.tar.gz opensim-SC_OLD-74dd38db70e88c5bf771774b6cc2ec80ab2ba215.tar.bz2 opensim-SC_OLD-74dd38db70e88c5bf771774b6cc2ec80ab2ba215.tar.xz |
One more module converted: AvatarFactoryModule.
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 37 |
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; | |||
39 | using OpenSim.Region.Framework.Scenes; | 39 | using OpenSim.Region.Framework.Scenes; |
40 | using OpenSim.Services.Interfaces; | 40 | using OpenSim.Services.Interfaces; |
41 | 41 | ||
42 | using Mono.Addins; | ||
43 | |||
42 | namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | 44 | namespace 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; |