Add the ability to use -console=rest to the region server. User

and pass are specified the same way as for the ROBUST server
arthursv
Melanie 2009-08-17 09:21:39 +01:00
parent dc0f0f5da8
commit 3d7bb7567c
5 changed files with 30 additions and 5 deletions

View File

@ -185,7 +185,7 @@ namespace OpenSim.ConsoleClient
if (parts.Length != 3) if (parts.Length != 3)
continue; continue;
MainConsole.Instance.Output(parts[2], parts[1]); MainConsole.Instance.Output(parts[2].Trim(), parts[1]);
} }
Requester.MakeRequest(requestUrl, requestData, ReadResponses); Requester.MakeRequest(requestUrl, requestData, ReadResponses);

View File

@ -120,6 +120,7 @@ namespace OpenSim
configSource.AddSwitch("Startup", "gridmode"); configSource.AddSwitch("Startup", "gridmode");
configSource.AddSwitch("Startup", "physics"); configSource.AddSwitch("Startup", "physics");
configSource.AddSwitch("Startup", "gui"); configSource.AddSwitch("Startup", "gui");
configSource.AddSwitch("Startup", "console");
configSource.AddConfig("StandAlone"); configSource.AddConfig("StandAlone");
configSource.AddConfig("Network"); configSource.AddConfig("Network");

View File

@ -52,6 +52,7 @@ namespace OpenSim
protected string m_startupCommandsFile; protected string m_startupCommandsFile;
protected string m_shutdownCommandsFile; protected string m_shutdownCommandsFile;
protected bool m_gui = false; protected bool m_gui = false;
protected string m_consoleType = "local";
private string m_timedScript = "disabled"; private string m_timedScript = "disabled";
private Timer m_scriptTimer; private Timer m_scriptTimer;
@ -71,7 +72,10 @@ namespace OpenSim
m_startupCommandsFile = startupConfig.GetString("startup_console_commands_file", "startup_commands.txt"); m_startupCommandsFile = startupConfig.GetString("startup_console_commands_file", "startup_commands.txt");
m_shutdownCommandsFile = startupConfig.GetString("shutdown_console_commands_file", "shutdown_commands.txt"); m_shutdownCommandsFile = startupConfig.GetString("shutdown_console_commands_file", "shutdown_commands.txt");
if (startupConfig.GetString("console", String.Empty) == String.Empty)
m_gui = startupConfig.GetBoolean("gui", false); m_gui = startupConfig.GetBoolean("gui", false);
else
m_consoleType= startupConfig.GetString("console", String.Empty);
m_timedScript = startupConfig.GetString("timer_Script", "disabled"); m_timedScript = startupConfig.GetString("timer_Script", "disabled");
if (m_logFileAppender != null) if (m_logFileAppender != null)
@ -110,13 +114,31 @@ namespace OpenSim
if (m_gui) // Driven by external GUI if (m_gui) // Driven by external GUI
m_console = new CommandConsole("Region"); m_console = new CommandConsole("Region");
else else
{
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"); m_console = new LocalConsole("Region");
break;
}
}
MainConsole.Instance = m_console; MainConsole.Instance = m_console;
RegisterConsoleCommands(); RegisterConsoleCommands();
base.StartupSpecific(); base.StartupSpecific();
if (m_console is RemoteConsole)
((RemoteConsole)m_console).SetServer(m_httpServer);
//Run Startup Commands //Run Startup Commands
if (String.IsNullOrEmpty(m_startupCommandsFile)) if (String.IsNullOrEmpty(m_startupCommandsFile))
{ {

View File

@ -17,7 +17,7 @@
</appender> </appender>
<appender name="LogFileAppender" type="log4net.Appender.FileAppender"> <appender name="LogFileAppender" type="log4net.Appender.FileAppender">
<file value="OpenSim.log" /> <file value="OpenSim.ConsoleClient.log" />
<appendToFile value="true" /> <appendToFile value="true" />
<layout type="log4net.Layout.PatternLayout"> <layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date %-5level - %logger %message%newline" /> <conversionPattern value="%date %-5level - %logger %message%newline" />

View File

@ -292,6 +292,8 @@
LibrariesXMLFile="./inventory/Libraries.xml" LibrariesXMLFile="./inventory/Libraries.xml"
[Network] [Network]
ConsoleUser = "Test"
ConsolePass = "secret"
http_listener_port = 9000 http_listener_port = 9000
default_location_x = 1000 default_location_x = 1000
default_location_y = 1000 default_location_y = 1000