aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/ModuleLoader.cs
diff options
context:
space:
mode:
authorlbsa712007-10-30 09:05:31 +0000
committerlbsa712007-10-30 09:05:31 +0000
commit67e12b95ea7b68f4904a7484d77ecfd787d16d0c (patch)
tree20b00d24c8a7617017960432ec044852e3ad5fa9 /OpenSim/Region/Environment/ModuleLoader.cs
parent* Deleted .user file (diff)
downloadopensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.zip
opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.gz
opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.bz2
opensim-SC-67e12b95ea7b68f4904a7484d77ecfd787d16d0c.tar.xz
* Optimized usings
* Shortened type references * Removed redundant 'this' qualifier
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/ModuleLoader.cs19
1 files changed, 9 insertions, 10 deletions
diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs
index c0dd52a..cb72638 100644
--- a/OpenSim/Region/Environment/ModuleLoader.cs
+++ b/OpenSim/Region/Environment/ModuleLoader.cs
@@ -27,15 +27,14 @@
27*/ 27*/
28 28
29using System; 29using System;
30using System.Collections;
31using System.Collections.Generic; 30using System.Collections.Generic;
32using System.IO; 31using System.IO;
33using System.Reflection; 32using System.Reflection;
33using Nini.Config;
34using OpenSim.Framework.Console; 34using OpenSim.Framework.Console;
35using OpenSim.Region.Environment.Interfaces; 35using OpenSim.Region.Environment.Interfaces;
36using OpenSim.Region.Environment.Modules; 36using OpenSim.Region.Environment.Modules;
37using OpenSim.Region.Environment.Scenes; 37using OpenSim.Region.Environment.Scenes;
38using Nini.Config;
39 38
40namespace OpenSim.Region.Environment 39namespace OpenSim.Region.Environment
41{ 40{
@@ -58,8 +57,8 @@ namespace OpenSim.Region.Environment
58 { 57 {
59 get 58 get
60 { 59 {
61 IRegionModule[] regionModules = new IRegionModule[ m_loadedSharedModules.Count ]; 60 IRegionModule[] regionModules = new IRegionModule[m_loadedSharedModules.Count];
62 m_loadedSharedModules.Values.CopyTo( regionModules, 0 ); 61 m_loadedSharedModules.Values.CopyTo(regionModules, 0);
63 return regionModules; 62 return regionModules;
64 } 63 }
65 } 64 }
@@ -132,7 +131,7 @@ namespace OpenSim.Region.Environment
132 131
133 if (modules.Length > 0) 132 if (modules.Length > 0)
134 { 133 {
135 m_log.Verbose("MODULES", "Found Module Library [{0}]", dllName ); 134 m_log.Verbose("MODULES", "Found Module Library [{0}]", dllName);
136 foreach (IRegionModule module in modules) 135 foreach (IRegionModule module in modules)
137 { 136 {
138 if (!module.IsSharedModule) 137 if (!module.IsSharedModule)
@@ -179,16 +178,16 @@ namespace OpenSim.Region.Environment
179 List<IRegionModule> modules = new List<IRegionModule>(); 178 List<IRegionModule> modules = new List<IRegionModule>();
180 179
181 Assembly pluginAssembly; 180 Assembly pluginAssembly;
182 if (!LoadedAssemblys.TryGetValue(dllName, out pluginAssembly )) 181 if (!LoadedAssemblys.TryGetValue(dllName, out pluginAssembly))
183 { 182 {
184 try 183 try
185 { 184 {
186 pluginAssembly = Assembly.LoadFrom(dllName); 185 pluginAssembly = Assembly.LoadFrom(dllName);
187 LoadedAssemblys.Add(dllName, pluginAssembly); 186 LoadedAssemblys.Add(dllName, pluginAssembly);
188 } 187 }
189 catch( BadImageFormatException e ) 188 catch (BadImageFormatException e)
190 { 189 {
191 m_log.Verbose( "MODULES", "The file [{0}] is not a module assembly.", e.FileName ); 190 m_log.Verbose("MODULES", "The file [{0}] is not a module assembly.", e.FileName);
192 } 191 }
193 } 192 }
194 193
@@ -201,7 +200,7 @@ namespace OpenSim.Region.Environment
201 { 200 {
202 if (!pluginType.IsAbstract) 201 if (!pluginType.IsAbstract)
203 { 202 {
204 if( pluginType.GetInterface("IRegionModule") != null ) 203 if (pluginType.GetInterface("IRegionModule") != null)
205 { 204 {
206 modules.Add((IRegionModule) Activator.CreateInstance(pluginType)); 205 modules.Add((IRegionModule) Activator.CreateInstance(pluginType));
207 } 206 }
@@ -231,4 +230,4 @@ namespace OpenSim.Region.Environment
231 LoadedAssemblys.Clear(); 230 LoadedAssemblys.Clear();
232 } 231 }
233 } 232 }
234} 233} \ No newline at end of file