From a1aa362866fc59d331780ac799beee4a6d2613c6 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 28 Sep 2009 22:48:57 +0100 Subject: Allow the notation config_name@port/dll_name:class_name as a handler spec in OpenSim.Server.ini This allows things like "8003/AssetServirce.dll local@8004/InventoryService.dll" The config name is not yet supported by any modules --- OpenSim/Server/ServerMain.cs | 52 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 46 insertions(+), 6 deletions(-) (limited to 'OpenSim/Server/ServerMain.cs') diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs index 77dfebb..8851894 100644 --- a/OpenSim/Server/ServerMain.cs +++ b/OpenSim/Server/ServerMain.cs @@ -30,6 +30,7 @@ using log4net; using System.Reflection; using System; using System.Collections.Generic; +using OpenSim.Framework.Servers.HttpServer; using OpenSim.Server.Base; using OpenSim.Server.Handlers.Base; @@ -60,22 +61,61 @@ namespace OpenSim.Server string connList = serverConfig.GetString("ServiceConnectors", String.Empty); string[] conns = connList.Split(new char[] {',', ' '}); - foreach (string conn in conns) + foreach (string c in conns) { - if (conn == String.Empty) + if (c == String.Empty) continue; + string configName = String.Empty; + string conn = c; + uint port = 0; + + string[] split1 = conn.Split(new char[] {'/'}); + if (split1.Length > 1) + { + conn = split1[1]; + + string[] split2 = split1[0].Split(new char[] {'@'}); + if (split2.Length > 1) + { + configName = split2[0]; + port = Convert.ToUInt32(split2[1]); + } + else + { + port = Convert.ToUInt32(split1[0]); + } + } string[] parts = conn.Split(new char[] {':'}); string friendlyName = parts[0]; if (parts.Length > 1) friendlyName = parts[1]; + IHttpServer server = m_Server.HttpServer; + if (port != 0) + server = m_Server.GetHttpServer(port); + m_log.InfoFormat("[SERVER]: Loading {0}", friendlyName); - Object[] modargs = new Object[] { m_Server.Config, m_Server.HttpServer }; - IServiceConnector connector = - ServerUtils.LoadPlugin(conn, - modargs); + IServiceConnector connector = null; + try + { + Object[] modargs = new Object[] { m_Server.Config, server, + configName }; + connector = ServerUtils.LoadPlugin(conn, + modargs); + + if (connector == null) + { + modargs = new Object[] { m_Server.Config, server }; + connector = + ServerUtils.LoadPlugin(conn, + modargs); + } + } + catch (Exception) + { + } if (connector != null) { -- cgit v1.1 From f4e8ac35560c9c57a4ce64a7b3ee4343086cd128 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 28 Sep 2009 18:53:07 -0700 Subject: Fixed a bug that was causing exceptions to the thrown in ROBUST MainServer. --- OpenSim/Server/ServerMain.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'OpenSim/Server/ServerMain.cs') diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs index 8851894..01f2649 100644 --- a/OpenSim/Server/ServerMain.cs +++ b/OpenSim/Server/ServerMain.cs @@ -61,6 +61,7 @@ namespace OpenSim.Server string connList = serverConfig.GetString("ServiceConnectors", String.Empty); string[] conns = connList.Split(new char[] {',', ' '}); + int i = 0; foreach (string c in conns) { if (c == String.Empty) @@ -100,11 +101,14 @@ namespace OpenSim.Server IServiceConnector connector = null; try { - Object[] modargs = new Object[] { m_Server.Config, server, + Object[] modargs = null; + if (configName != string.Empty) + { + modargs = new Object[] { m_Server.Config, server, configName }; - connector = ServerUtils.LoadPlugin(conn, - modargs); - + connector = ServerUtils.LoadPlugin(conn, + modargs); + } if (connector == null) { modargs = new Object[] { m_Server.Config, server }; -- cgit v1.1 From 1096103d66d7391943efa85553f46a633cf0d3ee Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 29 Sep 2009 09:44:12 +0100 Subject: Fix loading modules with alternate configurations and ports into ROBUST. Make all current modules support the configuration name option --- OpenSim/Server/ServerMain.cs | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) (limited to 'OpenSim/Server/ServerMain.cs') diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs index 01f2649..a7b33c9 100644 --- a/OpenSim/Server/ServerMain.cs +++ b/OpenSim/Server/ServerMain.cs @@ -96,29 +96,23 @@ namespace OpenSim.Server if (port != 0) server = m_Server.GetHttpServer(port); - m_log.InfoFormat("[SERVER]: Loading {0}", friendlyName); + if (port != m_Server.DefaultPort) + m_log.InfoFormat("[SERVER]: Loading {0} on port {1}", friendlyName, port); + else + m_log.InfoFormat("[SERVER]: Loading {0}", friendlyName); IServiceConnector connector = null; - try - { - Object[] modargs = null; - if (configName != string.Empty) - { - modargs = new Object[] { m_Server.Config, server, - configName }; - connector = ServerUtils.LoadPlugin(conn, - modargs); - } - if (connector == null) - { - modargs = new Object[] { m_Server.Config, server }; - connector = - ServerUtils.LoadPlugin(conn, - modargs); - } - } - catch (Exception) + + Object[] modargs = new Object[] { m_Server.Config, server, + configName }; + connector = ServerUtils.LoadPlugin(conn, + modargs); + if (connector == null) { + modargs = new Object[] { m_Server.Config, server }; + connector = + ServerUtils.LoadPlugin(conn, + modargs); } if (connector != null) -- cgit v1.1