diff --git a/OpenSim/ConsoleClient/ConsoleClient.cs b/OpenSim/ConsoleClient/ConsoleClient.cs index 1e5f0b7261..319584fdf7 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 df8029046a..2fd26bf964 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 390cfcd020..38874f9ebd 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)) { diff --git a/bin/OpenSim.ConsoleClient.exe.config b/bin/OpenSim.ConsoleClient.exe.config index c2d93c0449..7aa974c471 100644 --- a/bin/OpenSim.ConsoleClient.exe.config +++ b/bin/OpenSim.ConsoleClient.exe.config @@ -17,7 +17,7 @@ - + diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index db993b4b57..a1532c5e03 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -292,6 +292,8 @@ LibrariesXMLFile="./inventory/Libraries.xml" [Network] + ConsoleUser = "Test" + ConsolePass = "secret" http_listener_port = 9000 default_location_x = 1000 default_location_y = 1000