From bec947cde31a57f4c240ac63b0cb30daef49e3e8 Mon Sep 17 00:00:00 2001 From: Johan Berntsson Date: Tue, 11 Mar 2008 03:10:21 +0000 Subject: [PATCH] The plugin loader can now handle plugin dependencies without hardcoding --- OpenSim/Region/Application/OpenSimMain.cs | 23 ++++--------------- .../3Di/LoadBalancer/LoadBalancerPlugin.cs | 1 + .../3Di/RegionProxy/RegionProxyPlugin.cs | 2 +- 3 files changed, 7 insertions(+), 19 deletions(-) diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index ea251471d8..33d09999c7 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -374,27 +374,14 @@ namespace OpenSim m_moduleLoader = new ModuleLoader(m_config); ExtensionNodeList nodes = AddinManager.GetExtensionNodes("/OpenSim/Startup"); - m_log.InfoFormat("[PLUGINS]: Loading {0} OpenSim application plugins", nodes.Count); foreach (TypeExtensionNode node in nodes) { - // First load the proxy server (if present) - if(node.Path.Contains("Proxy")) - { - IApplicationPlugin plugin = (IApplicationPlugin)node.CreateInstance(); - plugin.Initialise(this); - m_plugins.Add(plugin); - } - } - // then load the other modules - foreach (TypeExtensionNode node in nodes) - { - if(!node.Path.Contains("Proxy")) - { - IApplicationPlugin plugin = (IApplicationPlugin)node.CreateInstance(); - plugin.Initialise(this); - m_plugins.Add(plugin); - } + m_log.InfoFormat("[PLUGINS]: Loading OpenSim application plugin {0}", node.Path); + IApplicationPlugin plugin = (IApplicationPlugin)node.CreateInstance(); + plugin.Initialise(this); + m_plugins.Add(plugin); } + // Start UDP servers //for (int i = 0; i < m_udpServers.Count; i++) //{ diff --git a/ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs b/ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs index f8cac5bdab..27fa1481a7 100644 --- a/ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs +++ b/ThirdParty/3Di/LoadBalancer/LoadBalancerPlugin.cs @@ -54,6 +54,7 @@ using libsecondlife.Packets; [assembly:Addin] [assembly:AddinDependency ("OpenSim", "0.5")] +[assembly:AddinDependency ("RegionProxy", "0.1")] namespace OpenSim.ApplicationPlugins.LoadBalancer { diff --git a/ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs b/ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs index 99a6727f12..5ab7eaeeac 100644 --- a/ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs +++ b/ThirdParty/3Di/RegionProxy/RegionProxyPlugin.cs @@ -43,7 +43,7 @@ using Nwc.XmlRpc; using Mono.Addins; -[assembly:Addin] +[assembly:Addin ("RegionProxy", "0.1")] [assembly:AddinDependency ("OpenSim", "0.5")] namespace OpenSim.ApplicationPlugins.RegionProxy