diff options
author | Diva Canto | 2015-01-02 09:16:39 -0800 |
---|---|---|
committer | Diva Canto | 2015-01-02 09:16:39 -0800 |
commit | bd2ec3edf5b35bbe48143965b74c0ff6650782a7 (patch) | |
tree | 9663c07983aac3c605360111e7a1bd2b83f750db /OpenSim | |
parent | Changed the Robust-as-addin version number to match OpenSim release numbers. (diff) | |
download | opensim-SC-bd2ec3edf5b35bbe48143965b74c0ff6650782a7.zip opensim-SC-bd2ec3edf5b35bbe48143965b74c0ff6650782a7.tar.gz opensim-SC-bd2ec3edf5b35bbe48143965b74c0ff6650782a7.tar.bz2 opensim-SC-bd2ec3edf5b35bbe48143965b74c0ff6650782a7.tar.xz |
Bug fix in LoadPLugin so that it can take paths to dlls that look like this "C:\foo\MyDll.dll:MyType" -- the split on : was messing things up.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Services/Base/ServiceBase.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/OpenSim/Services/Base/ServiceBase.cs b/OpenSim/Services/Base/ServiceBase.cs index ef30cba..addbe94 100644 --- a/OpenSim/Services/Base/ServiceBase.cs +++ b/OpenSim/Services/Base/ServiceBase.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.IO; | ||
30 | using System.Reflection; | 31 | using System.Reflection; |
31 | using log4net; | 32 | using log4net; |
32 | using Nini.Config; | 33 | using Nini.Config; |
@@ -45,9 +46,15 @@ namespace OpenSim.Services.Base | |||
45 | 46 | ||
46 | public T LoadPlugin<T>(string dllName, Object[] args) where T:class | 47 | public T LoadPlugin<T>(string dllName, Object[] args) where T:class |
47 | { | 48 | { |
48 | string[] parts = dllName.Split(new char[] {':'}); | 49 | // The path:type separator : is unfortunate because it collides |
49 | 50 | // with Windows paths like C:\... | |
50 | dllName = parts[0]; | 51 | // When the path provided includes the drive, this fails. |
52 | // Hence the root/noroot thing going on here. | ||
53 | string pathRoot = Path.GetPathRoot(dllName); | ||
54 | string noRoot = dllName.Substring(pathRoot.Length); | ||
55 | string[] parts = noRoot.Split(new char[] {':'}); | ||
56 | |||
57 | dllName = pathRoot + parts[0]; | ||
51 | 58 | ||
52 | string className = String.Empty; | 59 | string className = String.Empty; |
53 | 60 | ||