From a1393db7f0cb542f10f52ac739c78f15ee28ce77 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 10 Feb 2009 12:25:29 +0000 Subject: Stopgap measure: To use gridlaunch, or GUI, start opensim with OpenSim.exe -gui=true --- OpenSim/Framework/Console/ConsoleBase.cs | 30 ++++++++++++++++++++++++++++++ OpenSim/Region/Application/Application.cs | 2 +- OpenSim/Region/Application/OpenSim.cs | 4 ++++ 3 files changed, 35 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs index 7e4397b..e98944c 100644 --- a/OpenSim/Framework/Console/ConsoleBase.cs +++ b/OpenSim/Framework/Console/ConsoleBase.cs @@ -379,6 +379,7 @@ namespace OpenSim.Framework.Console public Commands Commands = new Commands(); private bool echo = true; private List history = new List(); + private bool gui = false; public object ConsoleScene = null; @@ -401,6 +402,11 @@ namespace OpenSim.Framework.Console "Get general command list or more detailed help on a specific command", Help); } + public void SetGuiMode(bool mode) + { + gui = mode; + } + private void AddToHistory(string text) { while (history.Count >= 100) @@ -813,6 +819,30 @@ namespace OpenSim.Framework.Console echo = e; int historyLine = history.Count; + if (gui) + { + System.Console.Write("{0}", prompt); + string cmdinput = System.Console.ReadLine(); + + if (isCommand) + { + string[] cmd = Commands.Resolve(Parser.Parse(cmdinput)); + + if (cmd.Length != 0) + { + int i; + + for (i=0 ; i < cmd.Length ; i++) + { + if (cmd[i].Contains(" ")) + cmd[i] = "\"" + cmd[i] + "\""; + } + return String.Empty; + } + } + return cmdinput; + } + System.Console.CursorLeft = 0; // Needed for mono System.Console.Write(" "); // Needed for mono diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 7a427dc..b9e82a4 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -84,13 +84,13 @@ namespace OpenSim configSource.AddSwitch("Startup", "physics"); configSource.AddSwitch("Startup", "useexecutepath"); configSource.AddSwitch("Startup", "hypergrid"); + configSource.AddSwitch("Startup", "gui"); configSource.AddConfig("StandAlone"); configSource.AddConfig("Network"); bool background = configSource.Configs["Startup"].GetBoolean("background", false); bool hgrid = configSource.Configs["Startup"].GetBoolean("hypergrid", false); - m_saveCrashDumps = configSource.Configs["Startup"].GetBoolean("save_crashes", false); m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir); diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index d706e05..1c7751d 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -58,6 +58,7 @@ namespace OpenSim private string m_timedScript = "disabled"; private Timer m_scriptTimer; + private bool m_gui = false; public OpenSim(IConfigSource configSource) : base(configSource) { @@ -74,6 +75,8 @@ namespace OpenSim m_startupCommandsFile = startupConfig.GetString("startup_console_commands_file", String.Empty); m_shutdownCommandsFile = startupConfig.GetString("shutdown_console_commands_file", String.Empty); + m_gui = startupConfig.GetBoolean("gui", false); + m_timedScript = startupConfig.GetString("timer_Script", "disabled"); } } @@ -93,6 +96,7 @@ namespace OpenSim //m_log.InfoFormat("[OPENSIM MAIN]: GC Latency Mode: {0}", GCSettings.LatencyMode.ToString()); m_console = new ConsoleBase("Region"); + m_console.SetGuiMode(m_gui); MainConsole.Instance = m_console; m_console.Commands.AddCommand("region", "clear assets", -- cgit v1.1