aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2009-05-18 21:04:25 +0000
committerMelanie Thielker2009-05-18 21:04:25 +0000
commitf7dbfe63e55ca875c1079084c4ca153f9a815327 (patch)
treefd73a0ddac4237b6f7ee5fc5462d89c557739ff6
parentDLL name change in config var. (diff)
downloadopensim-SC_OLD-f7dbfe63e55ca875c1079084c4ca153f9a815327.zip
opensim-SC_OLD-f7dbfe63e55ca875c1079084c4ca153f9a815327.tar.gz
opensim-SC_OLD-f7dbfe63e55ca875c1079084c4ca153f9a815327.tar.bz2
opensim-SC_OLD-f7dbfe63e55ca875c1079084c4ca153f9a815327.tar.xz
This commit changes the way the new server works. There is no longer a server
exe for each function, rather each function is a connector and the server ini loads them. If you like your multiple processes, use -inifile with the server. Otherwise, you get one server process that serves all configured funcions, see example .ini. The new exe is OpenSim.Server.exe. Clean your bin, loads of names have changed!
-rw-r--r--OpenSim/Server/Handlers/Asset/AssetServerConnector.cs6
-rw-r--r--OpenSim/Server/ServerMain.cs (renamed from OpenSim/Server/AssetServer/AssetServerMain.cs)54
-rw-r--r--bin/OpenSim.Server.exe.config (renamed from bin/OpenSim.Servers.AssetServer.exe.config)0
-rw-r--r--bin/OpenSim.Server.ini.example (renamed from bin/OpenSim.Servers.AssetServer.ini.example)3
-rw-r--r--prebuild.xml8
5 files changed, 60 insertions, 11 deletions
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
index 64014f5..686e6dd 100644
--- a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
+++ b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs
@@ -30,14 +30,16 @@ using Nini.Config;
30using OpenSim.Server.Base; 30using OpenSim.Server.Base;
31using OpenSim.Services.Interfaces; 31using OpenSim.Services.Interfaces;
32using OpenSim.Framework.Servers.HttpServer; 32using OpenSim.Framework.Servers.HttpServer;
33using OpenSim.Server.Handlers.Base;
33 34
34namespace OpenSim.Server.Handlers.Asset 35namespace OpenSim.Server.Handlers.Asset
35{ 36{
36 public class AssetServiceConnector 37 public class AssetServiceConnector : ServiceConnector
37 { 38 {
38 private IAssetService m_AssetService; 39 private IAssetService m_AssetService;
39 40
40 public AssetServiceConnector(IConfigSource config, IHttpServer server) 41 public AssetServiceConnector(IConfigSource config, IHttpServer server) :
42 base(config, server)
41 { 43 {
42 IConfig serverConfig = config.Configs["AssetService"]; 44 IConfig serverConfig = config.Configs["AssetService"];
43 if (serverConfig == null) 45 if (serverConfig == null)
diff --git a/OpenSim/Server/AssetServer/AssetServerMain.cs b/OpenSim/Server/ServerMain.cs
index b08c8cf..352ae98 100644
--- a/OpenSim/Server/AssetServer/AssetServerMain.cs
+++ b/OpenSim/Server/ServerMain.cs
@@ -25,25 +25,69 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using Nini.Config;
29using log4net;
30using System.Reflection;
28using System; 31using System;
32using System.Collections.Generic;
29using OpenSim.Server.Base; 33using OpenSim.Server.Base;
34using OpenSim.Server.Handlers.Base;
30using OpenSim.Server.Handlers.Asset; 35using OpenSim.Server.Handlers.Asset;
31 36
32namespace OpenSim.Server.AssetServer 37namespace OpenSim.Server
33{ 38{
34 public class AssetServer 39 public class OpenSimServer
35 { 40 {
41 private static readonly ILog m_log =
42 LogManager.GetLogger(
43 MethodBase.GetCurrentMethod().DeclaringType);
44
36 protected static HttpServerBase m_Server = null; 45 protected static HttpServerBase m_Server = null;
37 46
38 protected static AssetServiceConnector m_AssetServiceConnector; 47 protected static List<IServiceConnector> m_ServiceConnectors =
48 new List<IServiceConnector>();
39 49
40 static int Main(string[] args) 50 static int Main(string[] args)
41 { 51 {
42 m_Server = new HttpServerBase("Asset", args); 52 m_Server = new HttpServerBase("Asset", args);
43 53
44 m_AssetServiceConnector = new AssetServiceConnector(m_Server.Config, 54 IConfig serverConfig = m_Server.Config.Configs["Startup"];
45 m_Server.HttpServer); 55 if (serverConfig == null)
56 {
57 System.Console.WriteLine("Startup config section missing in .ini file");
58 throw new Exception("Configuration error");
59 }
60
61 string connList = serverConfig.GetString("ServiceConnectors", String.Empty);
62 string[] conns = connList.Split(new char[] {',', ' '});
63
64 foreach (string conn in conns)
65 {
66 if (conn == String.Empty)
67 continue;
68
69 string[] parts = conn.Split(new char[] {':'});
70 string friendlyName = parts[0];
71 if (parts.Length > 1)
72 friendlyName = parts[1];
73
74 m_log.InfoFormat("[SERVER]: Loading {0}", friendlyName);
75
76 Object[] modargs = new Object[] { m_Server.Config, m_Server.HttpServer };
77 IServiceConnector connector =
78 ServerUtils.LoadPlugin<IServiceConnector>(conn,
79 modargs);
46 80
81 if (connector != null)
82 {
83 m_ServiceConnectors.Add(connector);
84 m_log.InfoFormat("[SERVER]: {0} loaded successfully", friendlyName);
85 }
86 else
87 {
88 m_log.InfoFormat("[SERVER]: Failed to load {0}", conn);
89 }
90 }
47 return m_Server.Run(); 91 return m_Server.Run();
48 } 92 }
49 } 93 }
diff --git a/bin/OpenSim.Servers.AssetServer.exe.config b/bin/OpenSim.Server.exe.config
index c2d93c0..c2d93c0 100644
--- a/bin/OpenSim.Servers.AssetServer.exe.config
+++ b/bin/OpenSim.Server.exe.config
diff --git a/bin/OpenSim.Servers.AssetServer.ini.example b/bin/OpenSim.Server.ini.example
index 656ded0..b2e0f96 100644
--- a/bin/OpenSim.Servers.AssetServer.ini.example
+++ b/bin/OpenSim.Server.ini.example
@@ -5,6 +5,9 @@
5; inifile = "OpenSim.Servers.AssetServer.ini" 5; inifile = "OpenSim.Servers.AssetServer.ini"
6; logfile = "AssetServer.log" ; Also read from application config file 6; logfile = "AssetServer.log" ; Also read from application config file
7 7
8; Connectors, comma separated
9ServiceConnectors = "OpenSim.Server.Handlers.dll:AssetServiceConnector"
10
8[Network] 11[Network]
9port = 8003 12port = 8003
10 13
diff --git a/prebuild.xml b/prebuild.xml
index 1c4d41e..697c266 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -1418,19 +1418,19 @@
1418 </Files> 1418 </Files>
1419 </Project> 1419 </Project>
1420 1420
1421 <Project name="OpenSim.Server.AssetServer" path="OpenSim/Server/AssetServer" type="Exe"> 1421 <Project name="OpenSim.Server" path="OpenSim/Server" type="Exe">
1422 <Configuration name="Debug"> 1422 <Configuration name="Debug">
1423 <Options> 1423 <Options>
1424 <OutputPath>../../../bin/</OutputPath> 1424 <OutputPath>../../bin/</OutputPath>
1425 </Options> 1425 </Options>
1426 </Configuration> 1426 </Configuration>
1427 <Configuration name="Release"> 1427 <Configuration name="Release">
1428 <Options> 1428 <Options>
1429 <OutputPath>../../../bin/</OutputPath> 1429 <OutputPath>../../bin/</OutputPath>
1430 </Options> 1430 </Options>
1431 </Configuration> 1431 </Configuration>
1432 1432
1433 <ReferencePath>../../../bin/</ReferencePath> 1433 <ReferencePath>../../bin/</ReferencePath>
1434 <Reference name="System"/> 1434 <Reference name="System"/>
1435 <Reference name="System.Xml"/> 1435 <Reference name="System.Xml"/>
1436 <Reference name="OpenMetaverseTypes.dll"/> 1436 <Reference name="OpenMetaverseTypes.dll"/>