mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 10:46:00 +08:00
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
This commit is contained in:
@@ -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<IServiceConnector>(conn,
|
||||
modargs);
|
||||
IServiceConnector connector = null;
|
||||
try
|
||||
{
|
||||
Object[] modargs = new Object[] { m_Server.Config, server,
|
||||
configName };
|
||||
connector = ServerUtils.LoadPlugin<IServiceConnector>(conn,
|
||||
modargs);
|
||||
|
||||
if (connector == null)
|
||||
{
|
||||
modargs = new Object[] { m_Server.Config, server };
|
||||
connector =
|
||||
ServerUtils.LoadPlugin<IServiceConnector>(conn,
|
||||
modargs);
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
if (connector != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user