From b2111f6a19235f38c90dad26c7bf041b950b0bd7 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sun, 10 May 2009 22:31:10 +0000 Subject: Enhance the submodule loader and port the enhancements to the services base --- OpenSim/Servers/Base/ServerUtils.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'OpenSim/Servers/Base') diff --git a/OpenSim/Servers/Base/ServerUtils.cs b/OpenSim/Servers/Base/ServerUtils.cs index 4e8f472..834576b 100644 --- a/OpenSim/Servers/Base/ServerUtils.cs +++ b/OpenSim/Servers/Base/ServerUtils.cs @@ -96,6 +96,20 @@ namespace OpenSim.Servers.Base public static T LoadPlugin(string dllName, Object[] args) where T:class { + string[] parts = dllName.Split(new char[] {':'}); + + dllName = parts[0]; + + string className = String.Empty; + + if (parts.Length > 1) + className = parts[1]; + + return LoadPlugin(dllName, className, args); + } + + public static T LoadPlugin(string dllName, string className, Object[] args) where T:class + { string interfaceName = typeof(T).ToString(); try @@ -106,6 +120,11 @@ namespace OpenSim.Servers.Base { if (pluginType.IsPublic) { + if (className != String.Empty && + pluginType.ToString() != + pluginType.Namespace + "." + className) + continue; + Type typeInterface = pluginType.GetInterface(interfaceName, true); if (typeInterface != null) -- cgit v1.1