From 7daf6dbbd3ae70f43793c360bc3ab08efd89e850 Mon Sep 17 00:00:00 2001 From: Melanie Date: Fri, 21 Aug 2009 11:35:40 +0100 Subject: [PATCH] Add -xmlfile= option to UGM, to let the files be outside bin if desired --- OpenSim/Grid/GridServer/GridServerBase.cs | 3 ++- OpenSim/Grid/GridServer/Program.cs | 2 ++ OpenSim/Grid/MessagingServer/Main.cs | 4 +++- OpenSim/Grid/UserServer/Main.cs | 5 ++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs index e3ad52abb1..d63ac2eb30 100644 --- a/OpenSim/Grid/GridServer/GridServerBase.cs +++ b/OpenSim/Grid/GridServer/GridServerBase.cs @@ -49,6 +49,7 @@ namespace OpenSim.Grid.GridServer protected GridConfig m_config; public string m_consoleType = "local"; public IConfigSource m_configSource = null; + public string m_configFile = "GridServer_Config.xml"; public GridConfig Config { @@ -91,7 +92,7 @@ namespace OpenSim.Grid.GridServer break; } MainConsole.Instance = m_console; - m_config = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), "GridServer_Config.xml"))); + m_config = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), m_configFile))); m_log.Info("[GRID]: Starting HTTP process"); m_httpServer = new BaseHttpServer(m_config.HttpPort); diff --git a/OpenSim/Grid/GridServer/Program.cs b/OpenSim/Grid/GridServer/Program.cs index c7ba897b9a..741a01b94a 100644 --- a/OpenSim/Grid/GridServer/Program.cs +++ b/OpenSim/Grid/GridServer/Program.cs @@ -36,6 +36,7 @@ namespace OpenSim.Grid.GridServer { ArgvConfigSource argvSource = new ArgvConfigSource(args); argvSource.AddSwitch("Startup", "console", "c"); + argvSource.AddSwitch("Startup", "xmlfile", "x"); XmlConfigurator.Configure(); @@ -45,6 +46,7 @@ namespace OpenSim.Grid.GridServer if (startupConfig != null) { app.m_consoleType = startupConfig.GetString("console", "local"); + app.m_configFile = startupConfig.GetString("xmlfile", "GridServer_Config.xml"); } app.m_configSource = argvSource; diff --git a/OpenSim/Grid/MessagingServer/Main.cs b/OpenSim/Grid/MessagingServer/Main.cs index 654e770dfd..c8035a4381 100644 --- a/OpenSim/Grid/MessagingServer/Main.cs +++ b/OpenSim/Grid/MessagingServer/Main.cs @@ -59,6 +59,7 @@ namespace OpenSim.Grid.MessagingServer protected static string m_consoleType = "local"; protected static IConfigSource m_config = null; + protected static string m_configFile = "MessagingServer_Config.xml"; public static void Main(string[] args) { @@ -69,6 +70,7 @@ namespace OpenSim.Grid.MessagingServer if (startupConfig != null) { m_consoleType = startupConfig.GetString("console", "local"); + m_configFile = startupConfig.GetString("xmlfile", "MessagingServer_Config.xml"); } m_config = argvSource; @@ -164,7 +166,7 @@ namespace OpenSim.Grid.MessagingServer protected override void StartupSpecific() { - Cfg = new MessageServerConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), "MessagingServer_Config.xml"))); + Cfg = new MessageServerConfig("MESSAGING SERVER", (Path.Combine(Util.configDir(), m_configFile))); m_userDataBaseService = new UserDataBaseService(); m_userDataBaseService.AddPlugin(Cfg.DatabaseProvider, Cfg.DatabaseConnect); diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 1ee53ef6ec..baf0fd3145 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -76,16 +76,19 @@ namespace OpenSim.Grid.UserServer protected static string m_consoleType = "local"; protected static IConfigSource m_config = null; + protected static string m_configFile = "UserServer_Config.xml"; public static void Main(string[] args) { ArgvConfigSource argvSource = new ArgvConfigSource(args); argvSource.AddSwitch("Startup", "console", "c"); + argvSource.AddSwitch("Startup", "xmlfile", "x"); IConfig startupConfig = argvSource.Configs["Startup"]; if (startupConfig != null) { m_consoleType = startupConfig.GetString("console", "local"); + m_configFile = startupConfig.GetString("xmlfile", "UserServer_Config.xml"); } m_config = argvSource; @@ -151,7 +154,7 @@ namespace OpenSim.Grid.UserServer protected virtual IInterServiceInventoryServices StartupCoreComponents() { - Cfg = new UserConfig("USER SERVER", (Path.Combine(Util.configDir(), "UserServer_Config.xml"))); + Cfg = new UserConfig("USER SERVER", (Path.Combine(Util.configDir(), m_configFile))); m_httpServer = new BaseHttpServer(Cfg.HttpPort);