diff options
author | Justin Clarke Casey | 2008-11-20 19:52:55 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-20 19:52:55 +0000 |
commit | b9c07730f5216e8baa61185437cc5023d8c70200 (patch) | |
tree | 2da8bfe0144f3b29a056ed76edc223106ad3ca39 /OpenSim/Region/Physics | |
parent | * Allow physics dlls to be loaded separately, rather than just the contents o... (diff) | |
download | opensim-SC-b9c07730f5216e8baa61185437cc5023d8c70200.zip opensim-SC-b9c07730f5216e8baa61185437cc5023d8c70200.tar.gz opensim-SC-b9c07730f5216e8baa61185437cc5023d8c70200.tar.bz2 opensim-SC-b9c07730f5216e8baa61185437cc5023d8c70200.tar.xz |
* refactor: change some method names and doc in the physics plugin manager
* move the directory choice for plugins outside into RegionApplicationBase
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs index 71fad02..428a586 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs | |||
@@ -104,26 +104,26 @@ namespace OpenSim.Region.Physics.Manager | |||
104 | } | 104 | } |
105 | 105 | ||
106 | /// <summary> | 106 | /// <summary> |
107 | /// Load all built-in 'plugins' and those in the bin/Physics diretory | 107 | /// Load all plugins in assemblies at the given path |
108 | /// </summary> | 108 | /// </summary> |
109 | public void LoadPlugins() | 109 | /// <param name="pluginsPath"></param> |
110 | public void LoadPluginsFromAssemblies(string assembliesPath) | ||
110 | { | 111 | { |
111 | // And now walk all assemblies (DLLs effectively) and see if they are home | 112 | // Walk all assemblies (DLLs effectively) and see if they are home |
112 | // of a plugin that is of interest for us | 113 | // of a plugin that is of interest for us |
113 | string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Physics"); | 114 | string[] pluginFiles = Directory.GetFiles(assembliesPath, "*.dll"); |
114 | string[] pluginFiles = Directory.GetFiles(path, "*.dll"); | ||
115 | 115 | ||
116 | for (int i = 0; i < pluginFiles.Length; i++) | 116 | for (int i = 0; i < pluginFiles.Length; i++) |
117 | { | 117 | { |
118 | LoadPlugin(pluginFiles[i]); | 118 | LoadPluginsFromAssembly(pluginFiles[i]); |
119 | } | 119 | } |
120 | } | 120 | } |
121 | 121 | ||
122 | /// <summary> | 122 | /// <summary> |
123 | /// Load plugins from a dll at the given path | 123 | /// Load plugins from an assembly at the given path |
124 | /// </summary> | 124 | /// </summary> |
125 | /// <param name="dllPath"></param> | 125 | /// <param name="assemblyPath"></param> |
126 | public void LoadPlugin(string dllPath) | 126 | public void LoadPluginsFromAssembly(string assemblyPath) |
127 | { | 127 | { |
128 | // TODO / NOTE | 128 | // TODO / NOTE |
129 | // The assembly named 'OpenSim.Region.Physics.BasicPhysicsPlugin' was loaded from | 129 | // The assembly named 'OpenSim.Region.Physics.BasicPhysicsPlugin' was loaded from |
@@ -138,11 +138,11 @@ namespace OpenSim.Region.Physics.Manager | |||
138 | 138 | ||
139 | try | 139 | try |
140 | { | 140 | { |
141 | pluginAssembly = Assembly.LoadFrom(dllPath); | 141 | pluginAssembly = Assembly.LoadFrom(assemblyPath); |
142 | } | 142 | } |
143 | catch (Exception ex) | 143 | catch (Exception ex) |
144 | { | 144 | { |
145 | m_log.Error("[PHYSICS]: Failed to load plugin from " + dllPath, ex); | 145 | m_log.Error("[PHYSICS]: Failed to load plugin from " + assemblyPath, ex); |
146 | } | 146 | } |
147 | 147 | ||
148 | if (pluginAssembly != null) | 148 | if (pluginAssembly != null) |
@@ -153,12 +153,12 @@ namespace OpenSim.Region.Physics.Manager | |||
153 | } | 153 | } |
154 | catch (ReflectionTypeLoadException ex) | 154 | catch (ReflectionTypeLoadException ex) |
155 | { | 155 | { |
156 | m_log.Error("[PHYSICS]: Failed to enumerate types in plugin from " + dllPath + ": " + | 156 | m_log.Error("[PHYSICS]: Failed to enumerate types in plugin from " + assemblyPath + ": " + |
157 | ex.LoaderExceptions[0].Message, ex); | 157 | ex.LoaderExceptions[0].Message, ex); |
158 | } | 158 | } |
159 | catch (Exception ex) | 159 | catch (Exception ex) |
160 | { | 160 | { |
161 | m_log.Error("[PHYSICS]: Failed to enumerate types in plugin from " + dllPath, ex); | 161 | m_log.Error("[PHYSICS]: Failed to enumerate types in plugin from " + assemblyPath, ex); |
162 | } | 162 | } |
163 | 163 | ||
164 | if (types != null) | 164 | if (types != null) |