Fix module pathname handling for Windows
parent
203b492fce
commit
5f11b4658e
|
@ -139,8 +139,7 @@ namespace OpenSim.Server.Base
|
||||||
if (a.AddinFile.Contains(Registry.DefaultAddinsFolder))
|
if (a.AddinFile.Contains(Registry.DefaultAddinsFolder))
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[SERVER]: Adding {0} from registry", a.Name);
|
m_log.InfoFormat("[SERVER]: Adding {0} from registry", a.Name);
|
||||||
connector.PluginPath = String.Format("{0}/{1}", Registry.DefaultAddinsFolder, a.Name.Replace(',', '.'));
|
connector.PluginPath = System.IO.Path.Combine(Registry.DefaultAddinsFolder,a.Name.Replace(',', '.')); }
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[SERVER]: Adding {0} from ./bin", a.Name);
|
m_log.InfoFormat("[SERVER]: Adding {0} from ./bin", a.Name);
|
||||||
|
@ -222,14 +221,21 @@ namespace OpenSim.Server.Base
|
||||||
//if (dllName == string.Empty)
|
//if (dllName == string.Empty)
|
||||||
// Util.PrintCallStack();
|
// Util.PrintCallStack();
|
||||||
|
|
||||||
string[] parts = dllName.Split(new char[] {':'});
|
|
||||||
|
|
||||||
dllName = parts[0];
|
|
||||||
|
|
||||||
string className = String.Empty;
|
string className = String.Empty;
|
||||||
|
|
||||||
|
// The path for a dynamic plugin will contain ":" on Windows
|
||||||
|
string[] parts = dllName.Split (new char[] {':'});
|
||||||
|
|
||||||
|
if (parts [0].Length > 1) {
|
||||||
|
dllName = parts [0];
|
||||||
if (parts.Length > 1)
|
if (parts.Length > 1)
|
||||||
className = parts[1];
|
className = parts[1];
|
||||||
|
} else {
|
||||||
|
// This is Windows - we must replace the ":" in the path
|
||||||
|
dllName = String.Format ("{0}:{1}", parts [0], parts [1]);
|
||||||
|
if (parts.Length > 2)
|
||||||
|
className = parts[2];
|
||||||
|
}
|
||||||
|
|
||||||
return LoadPlugin<T>(dllName, className, args);
|
return LoadPlugin<T>(dllName, className, args);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue