From 13526097f24b7a8ad63b1d482c44b44397fa055f Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 1 May 2008 16:35:00 +0000 Subject: * Spring cleaning on Region.Environment. * Converted a large number of read-only fields to be actually, readonly. * Reformatted code sections. * Removed redundant code. --- OpenSim/Region/Environment/ModuleLoader.cs | 36 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region/Environment/ModuleLoader.cs') 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 public class ModuleLoader { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - - public Dictionary LoadedAssemblys = new Dictionary(); + private readonly IConfigSource m_config; private readonly List m_loadedModules = new List(); private readonly Dictionary m_loadedSharedModules = new Dictionary(); - private readonly IConfigSource m_config; + public Dictionary LoadedAssemblys = new Dictionary(); public ModuleLoader(IConfigSource config) { @@ -86,7 +85,8 @@ namespace OpenSim.Region.Environment DynamicTextureModule dynamicModule = new DynamicTextureModule(); if (m_loadedSharedModules.ContainsKey(dynamicModule.Name)) { - m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", dynamicModule.Name, "DynamicTextureModule"); + m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", dynamicModule.Name, + "DynamicTextureModule"); } else { @@ -123,15 +123,15 @@ namespace OpenSim.Region.Environment m_loadedSharedModules.Add(loadMod.Name, loadMod); } - // AvatarFactoryModule avatarFactory = new AvatarFactoryModule(); - // if (m_loadedSharedModules.ContainsKey(avatarFactory.Name)) - // { - // m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule"); - // } - // else - // { - // m_loadedSharedModules.Add(avatarFactory.Name, avatarFactory); - // } + // AvatarFactoryModule avatarFactory = new AvatarFactoryModule(); + // if (m_loadedSharedModules.ContainsKey(avatarFactory.Name)) + // { + // m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule"); + // } + // else + // { + // m_loadedSharedModules.Add(avatarFactory.Name, avatarFactory); + // } XMLRPCModule xmlRpcMod = new XMLRPCModule(); if (m_loadedSharedModules.ContainsKey(xmlRpcMod.Name)) @@ -149,13 +149,13 @@ namespace OpenSim.Region.Environment AssetTransactionModule transactionsModule = new AssetTransactionModule(); if (m_loadedSharedModules.ContainsKey(transactionsModule.Name)) { - m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", transactionsModule.Name, "TransactionModule"); + m_log.ErrorFormat("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", transactionsModule.Name, + "TransactionModule"); } else { m_loadedSharedModules.Add(transactionsModule.Name, transactionsModule); } - } public void InitialiseSharedModules(Scene scene) @@ -284,7 +284,7 @@ namespace OpenSim.Region.Environment { if (pluginType.GetInterface("IRegionModule") != null) { - modules.Add((IRegionModule)Activator.CreateInstance(pluginType)); + modules.Add((IRegionModule) Activator.CreateInstance(pluginType)); } } } @@ -320,8 +320,8 @@ namespace OpenSim.Region.Environment public void UnloadModule(IRegionModule rm) { rm.Close(); - + m_loadedModules.Remove(rm); } } -} +} \ No newline at end of file -- cgit v1.1