diff options
author | Melanie | 2009-09-28 22:48:57 +0100 |
---|---|---|
committer | Melanie | 2009-09-28 22:48:57 +0100 |
commit | a1aa362866fc59d331780ac799beee4a6d2613c6 (patch) | |
tree | 61b52240126221a612c22d155ce9446359b503fd /OpenSim/Server/ServerMain.cs | |
parent | Bump main version to 0.6.8-Dev (diff) | |
download | opensim-SC-a1aa362866fc59d331780ac799beee4a6d2613c6.zip opensim-SC-a1aa362866fc59d331780ac799beee4a6d2613c6.tar.gz opensim-SC-a1aa362866fc59d331780ac799beee4a6d2613c6.tar.bz2 opensim-SC-a1aa362866fc59d331780ac799beee4a6d2613c6.tar.xz |
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
Diffstat (limited to 'OpenSim/Server/ServerMain.cs')
-rw-r--r-- | OpenSim/Server/ServerMain.cs | 52 |
1 files changed, 46 insertions, 6 deletions
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; | |||
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using System; | 31 | using System; |
32 | using System.Collections.Generic; | 32 | using System.Collections.Generic; |
33 | using OpenSim.Framework.Servers.HttpServer; | ||
33 | using OpenSim.Server.Base; | 34 | using OpenSim.Server.Base; |
34 | using OpenSim.Server.Handlers.Base; | 35 | using OpenSim.Server.Handlers.Base; |
35 | 36 | ||
@@ -60,22 +61,61 @@ namespace OpenSim.Server | |||
60 | string connList = serverConfig.GetString("ServiceConnectors", String.Empty); | 61 | string connList = serverConfig.GetString("ServiceConnectors", String.Empty); |
61 | string[] conns = connList.Split(new char[] {',', ' '}); | 62 | string[] conns = connList.Split(new char[] {',', ' '}); |
62 | 63 | ||
63 | foreach (string conn in conns) | 64 | foreach (string c in conns) |
64 | { | 65 | { |
65 | if (conn == String.Empty) | 66 | if (c == String.Empty) |
66 | continue; | 67 | continue; |
67 | 68 | ||
69 | string configName = String.Empty; | ||
70 | string conn = c; | ||
71 | uint port = 0; | ||
72 | |||
73 | string[] split1 = conn.Split(new char[] {'/'}); | ||
74 | if (split1.Length > 1) | ||
75 | { | ||
76 | conn = split1[1]; | ||
77 | |||
78 | string[] split2 = split1[0].Split(new char[] {'@'}); | ||
79 | if (split2.Length > 1) | ||
80 | { | ||
81 | configName = split2[0]; | ||
82 | port = Convert.ToUInt32(split2[1]); | ||
83 | } | ||
84 | else | ||
85 | { | ||
86 | port = Convert.ToUInt32(split1[0]); | ||
87 | } | ||
88 | } | ||
68 | string[] parts = conn.Split(new char[] {':'}); | 89 | string[] parts = conn.Split(new char[] {':'}); |
69 | string friendlyName = parts[0]; | 90 | string friendlyName = parts[0]; |
70 | if (parts.Length > 1) | 91 | if (parts.Length > 1) |
71 | friendlyName = parts[1]; | 92 | friendlyName = parts[1]; |
72 | 93 | ||
94 | IHttpServer server = m_Server.HttpServer; | ||
95 | if (port != 0) | ||
96 | server = m_Server.GetHttpServer(port); | ||
97 | |||
73 | m_log.InfoFormat("[SERVER]: Loading {0}", friendlyName); | 98 | m_log.InfoFormat("[SERVER]: Loading {0}", friendlyName); |
74 | 99 | ||
75 | Object[] modargs = new Object[] { m_Server.Config, m_Server.HttpServer }; | 100 | IServiceConnector connector = null; |
76 | IServiceConnector connector = | 101 | try |
77 | ServerUtils.LoadPlugin<IServiceConnector>(conn, | 102 | { |
78 | modargs); | 103 | Object[] modargs = new Object[] { m_Server.Config, server, |
104 | configName }; | ||
105 | connector = ServerUtils.LoadPlugin<IServiceConnector>(conn, | ||
106 | modargs); | ||
107 | |||
108 | if (connector == null) | ||
109 | { | ||
110 | modargs = new Object[] { m_Server.Config, server }; | ||
111 | connector = | ||
112 | ServerUtils.LoadPlugin<IServiceConnector>(conn, | ||
113 | modargs); | ||
114 | } | ||
115 | } | ||
116 | catch (Exception) | ||
117 | { | ||
118 | } | ||
79 | 119 | ||
80 | if (connector != null) | 120 | if (connector != null) |
81 | { | 121 | { |