From 3d7bb7567c7452d4a1216db5656d0b02957cf950 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 17 Aug 2009 09:21:39 +0100 Subject: Add the ability to use -console=rest to the region server. User and pass are specified the same way as for the ROBUST server --- OpenSim/ConsoleClient/ConsoleClient.cs | 2 +- OpenSim/Region/Application/Application.cs | 3 ++- OpenSim/Region/Application/OpenSim.cs | 26 ++++++++++++++++++++++++-- 3 files changed, 27 insertions(+), 4 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/ConsoleClient/ConsoleClient.cs b/OpenSim/ConsoleClient/ConsoleClient.cs index 1e5f0b7..319584f 100644 --- a/OpenSim/ConsoleClient/ConsoleClient.cs +++ b/OpenSim/ConsoleClient/ConsoleClient.cs @@ -185,7 +185,7 @@ namespace OpenSim.ConsoleClient if (parts.Length != 3) continue; - MainConsole.Instance.Output(parts[2], parts[1]); + MainConsole.Instance.Output(parts[2].Trim(), parts[1]); } Requester.MakeRequest(requestUrl, requestData, ReadResponses); diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index df80290..2fd26bf 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -120,6 +120,7 @@ namespace OpenSim configSource.AddSwitch("Startup", "gridmode"); configSource.AddSwitch("Startup", "physics"); configSource.AddSwitch("Startup", "gui"); + configSource.AddSwitch("Startup", "console"); configSource.AddConfig("StandAlone"); configSource.AddConfig("Network"); @@ -223,4 +224,4 @@ namespace OpenSim _IsHandlingException = false; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 390cfcd..38874f9 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -52,6 +52,7 @@ namespace OpenSim protected string m_startupCommandsFile; protected string m_shutdownCommandsFile; protected bool m_gui = false; + protected string m_consoleType = "local"; private string m_timedScript = "disabled"; private Timer m_scriptTimer; @@ -71,7 +72,10 @@ namespace OpenSim m_startupCommandsFile = startupConfig.GetString("startup_console_commands_file", "startup_commands.txt"); m_shutdownCommandsFile = startupConfig.GetString("shutdown_console_commands_file", "shutdown_commands.txt"); - m_gui = startupConfig.GetBoolean("gui", false); + if (startupConfig.GetString("console", String.Empty) == String.Empty) + m_gui = startupConfig.GetBoolean("gui", false); + else + m_consoleType= startupConfig.GetString("console", String.Empty); m_timedScript = startupConfig.GetString("timer_Script", "disabled"); if (m_logFileAppender != null) @@ -110,13 +114,31 @@ namespace OpenSim if (m_gui) // Driven by external GUI m_console = new CommandConsole("Region"); else - m_console = new LocalConsole("Region"); + { + switch (m_consoleType) + { + case "basic": + m_console = new CommandConsole("Region"); + break; + case "rest": + m_console = new RemoteConsole("Region"); + ((RemoteConsole)m_console).ReadConfig(m_config.Source); + break; + default: + m_console = new LocalConsole("Region"); + break; + } + } + MainConsole.Instance = m_console; RegisterConsoleCommands(); base.StartupSpecific(); + if (m_console is RemoteConsole) + ((RemoteConsole)m_console).SetServer(m_httpServer); + //Run Startup Commands if (String.IsNullOrEmpty(m_startupCommandsFile)) { -- cgit v1.1