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