aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/ModuleLoader.cs
diff options
context:
space:
mode:
authorAdam Frisby2008-05-01 16:35:00 +0000
committerAdam Frisby2008-05-01 16:35:00 +0000
commit13526097f24b7a8ad63b1d482c44b44397fa055f (patch)
tree7a82c20ed7c63e2aea5ad3863325e37f64e1cbea /OpenSim/Region/Environment/ModuleLoader.cs
parent* Breaking all the code, breaking all the code..! (diff)
downloadopensim-SC-13526097f24b7a8ad63b1d482c44b44397fa055f.zip
opensim-SC-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.gz
opensim-SC-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.bz2
opensim-SC-13526097f24b7a8ad63b1d482c44b44397fa055f.tar.xz
* Spring cleaning on Region.Environment.
* Converted a large number of read-only fields to be actually, readonly. * Reformatted code sections. * Removed redundant code.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/ModuleLoader.cs36
1 files changed, 18 insertions, 18 deletions
diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs
index 3f8b9ff..caaa28f 100644
--- a/OpenSim/Region/Environment/ModuleLoader.cs
+++ b/OpenSim/Region/Environment/ModuleLoader.cs
@@ -47,12 +47,11 @@ namespace OpenSim.Region.Environment
47 public class ModuleLoader 47 public class ModuleLoader
48 { 48 {
49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
50 50 private readonly IConfigSource m_config;
51 public Dictionary<string, Assembly> LoadedAssemblys = new Dictionary<string, Assembly>();
52 51
53 private readonly List<IRegionModule> m_loadedModules = new List<IRegionModule>(); 52 private readonly List<IRegionModule> m_loadedModules = new List<IRegionModule>();
54 private readonly Dictionary<string, IRegionModule> m_loadedSharedModules = new Dictionary<string, IRegionModule>(); 53 private readonly Dictionary<string, IRegionModule> m_loadedSharedModules = new Dictionary<string, IRegionModule>();
55 private readonly IConfigSource m_config; 54 public Dictionary<string, Assembly> LoadedAssemblys = new Dictionary<string, Assembly>();
56 55
57 public ModuleLoader(IConfigSource config) 56 public ModuleLoader(IConfigSource config)
58 { 57 {
@@ -86,7 +85,8 @@ namespace OpenSim.Region.Environment
86 DynamicTextureModule dynamicModule = new DynamicTextureModule(); 85 DynamicTextureModule dynamicModule = new DynamicTextureModule();
87 if (m_loadedSharedModules.ContainsKey(dynamicModule.Name)) 86 if (m_loadedSharedModules.ContainsKey(dynamicModule.Name))
88 { 87 {
89 m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", dynamicModule.Name, "DynamicTextureModule"); 88 m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", dynamicModule.Name,
89 "DynamicTextureModule");
90 } 90 }
91 else 91 else
92 { 92 {
@@ -123,15 +123,15 @@ namespace OpenSim.Region.Environment
123 m_loadedSharedModules.Add(loadMod.Name, loadMod); 123 m_loadedSharedModules.Add(loadMod.Name, loadMod);
124 } 124 }
125 125
126 // AvatarFactoryModule avatarFactory = new AvatarFactoryModule(); 126 // AvatarFactoryModule avatarFactory = new AvatarFactoryModule();
127 // if (m_loadedSharedModules.ContainsKey(avatarFactory.Name)) 127 // if (m_loadedSharedModules.ContainsKey(avatarFactory.Name))
128 // { 128 // {
129 // m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule"); 129 // m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule");
130 // } 130 // }
131 // else 131 // else
132 // { 132 // {
133 // m_loadedSharedModules.Add(avatarFactory.Name, avatarFactory); 133 // m_loadedSharedModules.Add(avatarFactory.Name, avatarFactory);
134 // } 134 // }
135 135
136 XMLRPCModule xmlRpcMod = new XMLRPCModule(); 136 XMLRPCModule xmlRpcMod = new XMLRPCModule();
137 if (m_loadedSharedModules.ContainsKey(xmlRpcMod.Name)) 137 if (m_loadedSharedModules.ContainsKey(xmlRpcMod.Name))
@@ -149,13 +149,13 @@ namespace OpenSim.Region.Environment
149 AssetTransactionModule transactionsModule = new AssetTransactionModule(); 149 AssetTransactionModule transactionsModule = new AssetTransactionModule();
150 if (m_loadedSharedModules.ContainsKey(transactionsModule.Name)) 150 if (m_loadedSharedModules.ContainsKey(transactionsModule.Name))
151 { 151 {
152 m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", transactionsModule.Name, "TransactionModule"); 152 m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", transactionsModule.Name,
153 "TransactionModule");
153 } 154 }
154 else 155 else
155 { 156 {
156 m_loadedSharedModules.Add(transactionsModule.Name, transactionsModule); 157 m_loadedSharedModules.Add(transactionsModule.Name, transactionsModule);
157 } 158 }
158
159 } 159 }
160 160
161 public void InitialiseSharedModules(Scene scene) 161 public void InitialiseSharedModules(Scene scene)
@@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment
284 { 284 {
285 if (pluginType.GetInterface("IRegionModule") != null) 285 if (pluginType.GetInterface("IRegionModule") != null)
286 { 286 {
287 modules.Add((IRegionModule)Activator.CreateInstance(pluginType)); 287 modules.Add((IRegionModule) Activator.CreateInstance(pluginType));
288 } 288 }
289 } 289 }
290 } 290 }
@@ -320,8 +320,8 @@ namespace OpenSim.Region.Environment
320 public void UnloadModule(IRegionModule rm) 320 public void UnloadModule(IRegionModule rm)
321 { 321 {
322 rm.Close(); 322 rm.Close();
323 323
324 m_loadedModules.Remove(rm); 324 m_loadedModules.Remove(rm);
325 } 325 }
326 } 326 }
327} 327} \ No newline at end of file