diff options
author | BlueWall (James Hughes) | 2012-12-13 13:13:40 -0500 |
---|---|---|
committer | BlueWall | 2012-12-13 13:15:57 -0500 |
commit | 5f11b4658ef5a57297c9de89e0dbea4ca497b060 (patch) | |
tree | 13f29a3cc07046fa16acd32b2b0205ef7df8ca8b /OpenSim/Server | |
parent | Update mono addins (diff) | |
download | opensim-SC_OLD-5f11b4658ef5a57297c9de89e0dbea4ca497b060.zip opensim-SC_OLD-5f11b4658ef5a57297c9de89e0dbea4ca497b060.tar.gz opensim-SC_OLD-5f11b4658ef5a57297c9de89e0dbea4ca497b060.tar.bz2 opensim-SC_OLD-5f11b4658ef5a57297c9de89e0dbea4ca497b060.tar.xz |
Fix module pathname handling for Windows
Diffstat (limited to 'OpenSim/Server')
-rw-r--r-- | OpenSim/Server/Base/ServerUtils.cs | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs index d06d612..d6d3957 100644 --- a/OpenSim/Server/Base/ServerUtils.cs +++ b/OpenSim/Server/Base/ServerUtils.cs | |||
@@ -139,8 +139,7 @@ namespace OpenSim.Server.Base | |||
139 | if (a.AddinFile.Contains(Registry.DefaultAddinsFolder)) | 139 | if (a.AddinFile.Contains(Registry.DefaultAddinsFolder)) |
140 | { | 140 | { |
141 | m_log.InfoFormat("[SERVER]: Adding {0} from registry", a.Name); | 141 | m_log.InfoFormat("[SERVER]: Adding {0} from registry", a.Name); |
142 | connector.PluginPath = String.Format("{0}/{1}", Registry.DefaultAddinsFolder, a.Name.Replace(',', '.')); | 142 | connector.PluginPath = System.IO.Path.Combine(Registry.DefaultAddinsFolder,a.Name.Replace(',', '.')); } |
143 | } | ||
144 | else | 143 | else |
145 | { | 144 | { |
146 | m_log.InfoFormat("[SERVER]: Adding {0} from ./bin", a.Name); | 145 | m_log.InfoFormat("[SERVER]: Adding {0} from ./bin", a.Name); |
@@ -216,20 +215,27 @@ namespace OpenSim.Server.Base | |||
216 | /// <param name="dllName"></param> | 215 | /// <param name="dllName"></param> |
217 | /// <param name="args">The arguments which control which constructor is invoked on the plugin</param> | 216 | /// <param name="args">The arguments which control which constructor is invoked on the plugin</param> |
218 | /// <returns></returns> | 217 | /// <returns></returns> |
219 | public static T LoadPlugin<T>(string dllName, Object[] args) where T:class | 218 | public static T LoadPlugin<T> (string dllName, Object[] args) where T:class |
220 | { | 219 | { |
221 | // This is good to debug configuration problems | 220 | // This is good to debug configuration problems |
222 | //if (dllName == string.Empty) | 221 | //if (dllName == string.Empty) |
223 | // Util.PrintCallStack(); | 222 | // Util.PrintCallStack(); |
224 | 223 | ||
225 | string[] parts = dllName.Split(new char[] {':'}); | 224 | string className = String.Empty; |
226 | 225 | ||
227 | dllName = parts[0]; | 226 | // The path for a dynamic plugin will contain ":" on Windows |
228 | 227 | string[] parts = dllName.Split (new char[] {':'}); | |
229 | string className = String.Empty; | 228 | |
230 | 229 | if (parts [0].Length > 1) { | |
231 | if (parts.Length > 1) | 230 | dllName = parts [0]; |
232 | className = parts[1]; | 231 | if (parts.Length > 1) |
232 | className = parts[1]; | ||
233 | } else { | ||
234 | // This is Windows - we must replace the ":" in the path | ||
235 | dllName = String.Format ("{0}:{1}", parts [0], parts [1]); | ||
236 | if (parts.Length > 2) | ||
237 | className = parts[2]; | ||
238 | } | ||
233 | 239 | ||
234 | return LoadPlugin<T>(dllName, className, args); | 240 | return LoadPlugin<T>(dllName, className, args); |
235 | } | 241 | } |