From 0fd17c08ae642fac17b24dfad06c61cfe5739483 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 20 Aug 2019 23:28:59 +0100 Subject: Massive console refactor. Greatly simplify interface. --- OpenSim/Framework/ConfigurationMember.cs | 4 +- OpenSim/Framework/Console/ConsoleBase.cs | 86 +++++++-------------------- OpenSim/Framework/Console/ConsoleUtil.cs | 20 +++---- OpenSim/Framework/Console/LocalConsole.cs | 15 ++--- OpenSim/Framework/Console/MockConsole.cs | 14 ++--- OpenSim/Framework/Console/RemoteConsole.cs | 16 ++--- OpenSim/Framework/IConsole.cs | 17 ++---- OpenSim/Framework/Monitoring/ChecksManager.cs | 2 +- OpenSim/Framework/Monitoring/StatsLogger.cs | 4 +- OpenSim/Framework/Monitoring/StatsManager.cs | 10 ++-- OpenSim/Framework/Monitoring/WorkManager.cs | 18 +++--- OpenSim/Framework/PluginManager.cs | 6 +- OpenSim/Framework/RegionInfo.cs | 14 ++--- OpenSim/Framework/Servers/MainServer.cs | 12 ++-- OpenSim/Framework/Servers/ServerBase.cs | 12 ++-- 15 files changed, 93 insertions(+), 157 deletions(-) mode change 100644 => 100755 OpenSim/Framework/ConfigurationMember.cs mode change 100644 => 100755 OpenSim/Framework/Console/ConsoleUtil.cs mode change 100644 => 100755 OpenSim/Framework/Console/LocalConsole.cs mode change 100644 => 100755 OpenSim/Framework/Console/MockConsole.cs mode change 100644 => 100755 OpenSim/Framework/Console/RemoteConsole.cs mode change 100644 => 100755 OpenSim/Framework/IConsole.cs mode change 100644 => 100755 OpenSim/Framework/Monitoring/ChecksManager.cs mode change 100644 => 100755 OpenSim/Framework/Monitoring/StatsLogger.cs mode change 100644 => 100755 OpenSim/Framework/Monitoring/StatsManager.cs mode change 100644 => 100755 OpenSim/Framework/Monitoring/WorkManager.cs mode change 100644 => 100755 OpenSim/Framework/PluginManager.cs mode change 100644 => 100755 OpenSim/Framework/RegionInfo.cs mode change 100644 => 100755 OpenSim/Framework/Servers/MainServer.cs mode change 100644 => 100755 OpenSim/Framework/Servers/ServerBase.cs (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/ConfigurationMember.cs b/OpenSim/Framework/ConfigurationMember.cs old mode 100644 new mode 100755 index 7afa68a..32c6a3e --- a/OpenSim/Framework/ConfigurationMember.cs +++ b/OpenSim/Framework/ConfigurationMember.cs @@ -262,14 +262,14 @@ namespace OpenSim.Framework if (configurationDescription.Trim() != String.Empty) { console_result = - MainConsole.Instance.CmdPrompt( + MainConsole.Instance.Prompt( configurationDescription + ": " + configOption.configurationQuestion, configOption.configurationDefault); } else { console_result = - MainConsole.Instance.CmdPrompt(configOption.configurationQuestion, + MainConsole.Instance.Prompt(configOption.configurationQuestion, configOption.configurationDefault); } } diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs index 64cddea..56bda05 100755 --- a/OpenSim/Framework/Console/ConsoleBase.cs +++ b/OpenSim/Framework/Console/ConsoleBase.cs @@ -35,13 +35,13 @@ using log4net; namespace OpenSim.Framework.Console { - public class ConsoleBase + public class ConsoleBase : IConsole { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected string prompt = "# "; - public object ConsoleScene { get; set; } + public IScene ConsoleScene { get; set; } public string DefaultPrompt { get; set; } @@ -58,78 +58,39 @@ namespace OpenSim.Framework.Console { } - public virtual void Output(string text, string level) + public virtual void Output(string format, string level = null, params object[] components) { - Output(text); + System.Console.WriteLine(format, components); } - public virtual void Output(string text) - { - System.Console.WriteLine(text); - } - - public virtual void OutputFormat(string format, params object[] components) - { - Output(string.Format(format, components)); - } - - public string CmdPrompt(string p) - { - return ReadLine(String.Format("{0}: ", p), false, true); - } - - public string CmdPrompt(string p, string def) - { - string ret = ReadLine(String.Format("{0} [{1}]: ", p, def), false, true); - if (ret == String.Empty) - ret = def; - - return ret; - } - - public string CmdPrompt(string p, List excludedCharacters) + public virtual string Prompt(string p, string def = null, List excludedCharacters = null, bool echo = true) { bool itisdone = false; string ret = String.Empty; while (!itisdone) { itisdone = true; - ret = CmdPrompt(p); - foreach (char c in excludedCharacters) - { - if (ret.Contains(c.ToString())) - { - System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted."); - itisdone = false; - } - } - } - - return ret; - } - - public string CmdPrompt(string p, string def, List excludedCharacters) - { - bool itisdone = false; - string ret = String.Empty; - while (!itisdone) - { - itisdone = true; - ret = CmdPrompt(p, def); + if (def != null) + ret = ReadLine(String.Format("{0}: ", p), false, echo); + else + ret = ReadLine(String.Format("{0} [{1}]: ", p, def), false, echo); - if (ret == String.Empty) + if (ret == String.Empty && def != null) { ret = def; } else { - foreach (char c in excludedCharacters) + if (excludedCharacters != null) { - if (ret.Contains(c.ToString())) + foreach (char c in excludedCharacters) { - System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted."); - itisdone = false; + if (ret.Contains(c.ToString())) + { + System.Console.WriteLine("The character \"" + c.ToString() + "\" is not permitted."); + itisdone = false; + } } } } @@ -139,14 +100,14 @@ namespace OpenSim.Framework.Console } // Displays a command prompt and returns a default value, user may only enter 1 of 2 options - public string CmdPrompt(string prompt, string defaultresponse, List options) + public virtual string Prompt(string prompt, string defaultresponse, List options) { bool itisdone = false; string optstr = String.Empty; foreach (string s in options) optstr += " " + s; - string temp = CmdPrompt(prompt, defaultresponse); + string temp = Prompt(prompt, defaultresponse); while (itisdone == false) { if (options.Contains(temp)) @@ -156,19 +117,12 @@ namespace OpenSim.Framework.Console else { System.Console.WriteLine("Valid options are" + optstr); - temp = CmdPrompt(prompt, defaultresponse); + temp = Prompt(prompt, defaultresponse); } } return temp; } - // Displays a prompt and waits for the user to enter a string, then returns that string - // (Done with no echo and suitable for passwords) - public string PasswdPrompt(string p) - { - return ReadLine(String.Format("{0}: ", p), false, false); - } - public virtual string ReadLine(string p, bool isCommand, bool e) { System.Console.Write("{0}", p); diff --git a/OpenSim/Framework/Console/ConsoleUtil.cs b/OpenSim/Framework/Console/ConsoleUtil.cs old mode 100644 new mode 100755 index bfa05a2..5342a29 --- a/OpenSim/Framework/Console/ConsoleUtil.cs +++ b/OpenSim/Framework/Console/ConsoleUtil.cs @@ -75,7 +75,7 @@ namespace OpenSim.Framework.Console { if (File.Exists(path)) { - console.OutputFormat("File {0} already exists. Please move or remove it.", path); + console.Output("File {0} already exists. Please move or remove it.", null, path); return false; } @@ -97,7 +97,7 @@ namespace OpenSim.Framework.Console if (!UUID.TryParse(rawUuid, out uuid)) { if (console != null) - console.OutputFormat("ERROR: {0} is not a valid uuid", rawUuid); + console.Output("ERROR: {0} is not a valid uuid", null, rawUuid); return false; } @@ -110,7 +110,7 @@ namespace OpenSim.Framework.Console if (!uint.TryParse(rawLocalId, out localId)) { if (console != null) - console.OutputFormat("ERROR: {0} is not a valid local id", localId); + console.Output("ERROR: {0} is not a valid local id", null, localId); return false; } @@ -118,7 +118,7 @@ namespace OpenSim.Framework.Console if (localId == 0) { if (console != null) - console.OutputFormat("ERROR: {0} is not a valid local id - it must be greater than 0", localId); + console.Output("ERROR: {0} is not a valid local id - it must be greater than 0", null, localId); return false; } @@ -150,7 +150,7 @@ namespace OpenSim.Framework.Console } if (console != null) - console.OutputFormat("ERROR: {0} is not a valid UUID or local id", rawId); + console.Output("ERROR: {0} is not a valid UUID or local id", null, rawId); return false; } @@ -167,7 +167,7 @@ namespace OpenSim.Framework.Console if (!bool.TryParse(rawConsoleString, out b)) { if (console != null) - console.OutputFormat("ERROR: {0} is not a true or false value", rawConsoleString); + console.Output("ERROR: {0} is not a true or false value", null, rawConsoleString); return false; } @@ -187,7 +187,7 @@ namespace OpenSim.Framework.Console if (!int.TryParse(rawConsoleInt, out i)) { if (console != null) - console.OutputFormat("ERROR: {0} is not a valid integer", rawConsoleInt); + console.Output("ERROR: {0} is not a valid integer", null, rawConsoleInt); return false; } @@ -207,7 +207,7 @@ namespace OpenSim.Framework.Console if (!float.TryParse(rawConsoleInput, out i)) { if (console != null) - console.OutputFormat("ERROR: {0} is not a valid float", rawConsoleInput); + console.Output("ERROR: {0} is not a valid float", null, rawConsoleInput); return false; } @@ -227,7 +227,7 @@ namespace OpenSim.Framework.Console if (!double.TryParse(rawConsoleInput, out i)) { if (console != null) - console.OutputFormat("ERROR: {0} is not a valid double", rawConsoleInput); + console.Output("ERROR: {0} is not a valid double", null, rawConsoleInput); return false; } @@ -249,7 +249,7 @@ namespace OpenSim.Framework.Console if (i < 0) { if (console != null) - console.OutputFormat("ERROR: {0} is not a positive integer", rawConsoleInt); + console.Output("ERROR: {0} is not a positive integer", null, rawConsoleInt); return false; } diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs old mode 100644 new mode 100755 index ba32f50..55c5c7e --- a/OpenSim/Framework/Console/LocalConsole.cs +++ b/OpenSim/Framework/Console/LocalConsole.cs @@ -359,7 +359,7 @@ namespace OpenSim.Framework.Console { string outText = text; - if (level != LOGLEVEL_NONE) + if (level != null) { MatchCollection matches = m_categoryRegex.Matches(text); @@ -389,20 +389,15 @@ namespace OpenSim.Framework.Console System.Console.WriteLine(); } - public override void Output(string text) + public override void Output(string format, string level = null, params object[] components) { - Output(text, LOGLEVEL_NONE); - } - - public override void Output(string text, string level) - { - FireOnOutput(text); + FireOnOutput(format); lock (m_commandLine) { if (m_cursorYPosition == -1) { - WriteLocalText(text, level); + WriteLocalText(format, level); return; } @@ -418,7 +413,7 @@ namespace OpenSim.Framework.Console m_cursorYPosition = SetCursorTop(m_cursorYPosition); SetCursorLeft(0); - WriteLocalText(text, level); + WriteLocalText(format, level); m_cursorYPosition = System.Console.CursorTop; diff --git a/OpenSim/Framework/Console/MockConsole.cs b/OpenSim/Framework/Console/MockConsole.cs old mode 100644 new mode 100755 index e1ff720..d68b066 --- a/OpenSim/Framework/Console/MockConsole.cs +++ b/OpenSim/Framework/Console/MockConsole.cs @@ -56,21 +56,17 @@ namespace OpenSim.Framework.Console public string ReadLine(string p, bool isCommand, bool e) { return ""; } - public object ConsoleScene { + public IScene ConsoleScene { get { return null; } set {} } - public void Output(string text, string level) {} - public void Output(string text) {} - public void OutputFormat(string format, params object[] components) {} + public void Output(string format, string level, params object[] components) {} - public string CmdPrompt(string p) { return ""; } - public string CmdPrompt(string p, string def) { return ""; } - public string CmdPrompt(string p, List excludedCharacters) { return ""; } - public string CmdPrompt(string p, string def, List excludedCharacters) { return ""; } + public string Prompt(string p) { return ""; } + public string Prompt(string p, string def, List excludedCharacters, bool echo) { return ""; } - public string CmdPrompt(string prompt, string defaultresponse, List options) { return ""; } + public string Prompt(string prompt, string defaultresponse, List options) { return ""; } public string PasswdPrompt(string p) { return ""; } } diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs old mode 100644 new mode 100755 index b90b75f..16b4636 --- a/OpenSim/Framework/Console/RemoteConsole.cs +++ b/OpenSim/Framework/Console/RemoteConsole.cs @@ -188,13 +188,19 @@ namespace OpenSim.Framework.Console m_Server.AddHTTPHandler("/SessionCommand/", HandleHttpSessionCommand); } - public override void Output(string text, string level) + public override void Output(string format, string level = null, params object[] components) { - Output(text, level, false, false, false); + if (components.Length == 0) + Output(format, level, false, false, false); + else + Output(String.Format(format, components), level, false, false, false); } protected void Output(string text, string level, bool isPrompt, bool isCommand, bool isInput) { + if (level == null) + level = String.Empty; + // Increment the line number. It was 0 and they start at 1 // so we need to pre-increment. m_lineNumber++; @@ -228,12 +234,6 @@ namespace OpenSim.Framework.Console System.Console.WriteLine(text.Trim()); } - public override void Output(string text) - { - // Output plain (non-logging style) text. - Output(text, String.Empty, false, false, false); - } - public override string ReadLine(string p, bool isCommand, bool e) { // Output the prompt an prepare to wait. This diff --git a/OpenSim/Framework/IConsole.cs b/OpenSim/Framework/IConsole.cs old mode 100644 new mode 100755 index 79560d8..963e07f --- a/OpenSim/Framework/IConsole.cs +++ b/OpenSim/Framework/IConsole.cs @@ -32,22 +32,13 @@ namespace OpenSim.Framework { public interface IConsole { - object ConsoleScene { get; set; } + IScene ConsoleScene { get; set; } - void Output(string text, string level); - void Output(string text); - void OutputFormat(string format, params object[] components); + void Output(string format, string level = null, params object[] components); - string CmdPrompt(string p); - string CmdPrompt(string p, string def); - string CmdPrompt(string p, List excludedCharacters); - string CmdPrompt(string p, string def, List excludedCharacters); + string Prompt(string p, string def = null, List excludedCharacters = null, bool echo = true); // Displays a command prompt and returns a default value, user may only enter 1 of 2 options - string CmdPrompt(string prompt, string defaultresponse, List options); - - // Displays a prompt and waits for the user to enter a string, then returns that string - // (Done with no echo and suitable for passwords) - string PasswdPrompt(string p); + string Prompt(string prompt, string defaultresponse, List options); } } \ No newline at end of file diff --git a/OpenSim/Framework/Monitoring/ChecksManager.cs b/OpenSim/Framework/Monitoring/ChecksManager.cs old mode 100644 new mode 100755 index ff3b041..100b748 --- a/OpenSim/Framework/Monitoring/ChecksManager.cs +++ b/OpenSim/Framework/Monitoring/ChecksManager.cs @@ -88,7 +88,7 @@ namespace OpenSim.Framework.Monitoring con.Output("check categories available are:"); foreach (string category in RegisteredChecks.Keys) - con.OutputFormat(" {0}", category); + con.Output(" {0}", null, category); } // else // { diff --git a/OpenSim/Framework/Monitoring/StatsLogger.cs b/OpenSim/Framework/Monitoring/StatsLogger.cs old mode 100644 new mode 100755 index b719af9..4369b36 --- a/OpenSim/Framework/Monitoring/StatsLogger.cs +++ b/OpenSim/Framework/Monitoring/StatsLogger.cs @@ -79,7 +79,7 @@ namespace OpenSim.Framework.Monitoring if (cmd[2] == "start") { Start(); - con.OutputFormat("Now recording all stats to file every {0}ms", m_statsLogIntervalMs); + con.Output("Now recording all stats to file every {0}ms", null, m_statsLogIntervalMs); } else if (cmd[2] == "stop") { @@ -106,7 +106,7 @@ namespace OpenSim.Framework.Monitoring sw.WriteLine(line); } - MainConsole.Instance.OutputFormat("Stats saved to file {0}", path); + MainConsole.Instance.Output("Stats saved to file {0}", null, path); } public static void Start() diff --git a/OpenSim/Framework/Monitoring/StatsManager.cs b/OpenSim/Framework/Monitoring/StatsManager.cs old mode 100644 new mode 100755 index a6b341f..57b9474 --- a/OpenSim/Framework/Monitoring/StatsManager.cs +++ b/OpenSim/Framework/Monitoring/StatsManager.cs @@ -117,14 +117,14 @@ namespace OpenSim.Framework.Monitoring { con.Output("Statistic categories available are:"); foreach (string category in RegisteredStats.Keys) - con.OutputFormat(" {0}", category); + con.Output(" {0}", null, category); } else { SortedDictionary> category; if (!RegisteredStats.TryGetValue(categoryName, out category)) { - con.OutputFormat("No such category as {0}", categoryName); + con.Output("No such category as {0}", null, categoryName); } else { @@ -150,14 +150,14 @@ namespace OpenSim.Framework.Monitoring } else { - con.OutputFormat( - "No such stat {0} in {1}.{2}", statName, categoryName, containerName); + con.Output( + "No such stat {0} in {1}.{2}", null, statName, categoryName, containerName); } } } else { - con.OutputFormat("No such container {0} in category {1}", containerName, categoryName); + con.Output("No such container {0} in category {1}", null, containerName, categoryName); } } } diff --git a/OpenSim/Framework/Monitoring/WorkManager.cs b/OpenSim/Framework/Monitoring/WorkManager.cs old mode 100644 new mode 100755 index c6d97e1..f6e0799 --- a/OpenSim/Framework/Monitoring/WorkManager.cs +++ b/OpenSim/Framework/Monitoring/WorkManager.cs @@ -215,23 +215,23 @@ namespace OpenSim.Framework.Monitoring if (subCommand == "stop") { JobEngine.Stop(); - MainConsole.Instance.OutputFormat("Stopped job engine."); + MainConsole.Instance.Output("Stopped job engine."); } else if (subCommand == "start") { JobEngine.Start(); - MainConsole.Instance.OutputFormat("Started job engine."); + MainConsole.Instance.Output("Started job engine."); } else if (subCommand == "status") { - MainConsole.Instance.OutputFormat("Job engine running: {0}", JobEngine.IsRunning); + MainConsole.Instance.Output("Job engine running: {0}", null, JobEngine.IsRunning); JobEngine.Job job = JobEngine.CurrentJob; - MainConsole.Instance.OutputFormat("Current job {0}", job != null ? job.Name : "none"); + MainConsole.Instance.Output("Current job {0}", null, job != null ? job.Name : "none"); - MainConsole.Instance.OutputFormat( - "Jobs waiting: {0}", JobEngine.IsRunning ? JobEngine.JobsWaiting.ToString() : "n/a"); - MainConsole.Instance.OutputFormat("Log Level: {0}", JobEngine.LogLevel); + MainConsole.Instance.Output( + "Jobs waiting: {0}", null, JobEngine.IsRunning ? JobEngine.JobsWaiting.ToString() : "n/a"); + MainConsole.Instance.Output("Log Level: {0}", null, JobEngine.LogLevel); } else if (subCommand == "log") { @@ -246,12 +246,12 @@ namespace OpenSim.Framework.Monitoring // if (ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, args[4], out logLevel)) // { JobEngine.LogLevel = logLevel; - MainConsole.Instance.OutputFormat("Set debug log level to {0}", JobEngine.LogLevel); + MainConsole.Instance.Output("Set debug log level to {0}", null, JobEngine.LogLevel); // } } else { - MainConsole.Instance.OutputFormat("Unrecognized job engine subcommand {0}", subCommand); + MainConsole.Instance.Output("Unrecognized job engine subcommand {0}", null, subCommand); } } } diff --git a/OpenSim/Framework/PluginManager.cs b/OpenSim/Framework/PluginManager.cs old mode 100644 new mode 100755 index 0c94fcb..c5e860d --- a/OpenSim/Framework/PluginManager.cs +++ b/OpenSim/Framework/PluginManager.cs @@ -129,7 +129,7 @@ namespace OpenSim.Framework } Addin addin = addins[ndx]; - MainConsole.Instance.OutputFormat("Uninstalling plugin {0}", addin.Id); + MainConsole.Instance.Output("Uninstalling plugin {0}", null, addin.Id); AddinManager.Registry.DisableAddin(addin.Id); addin.Enabled = false; IProgressStatus ps = new ConsoleProgressStatus(false); @@ -487,7 +487,7 @@ namespace OpenSim.Framework } else { - MainConsole.Instance.OutputFormat("Not Enabled in this domain {0}", addin.Name); + MainConsole.Instance.Output("Not Enabled in this domain {0}", null, addin.Name); } return; } @@ -503,7 +503,7 @@ namespace OpenSim.Framework foreach (Addin addin in addins) { - MainConsole.Instance.OutputFormat("Addin {0}", addin.Name); + MainConsole.Instance.Output("Addin {0}", null, addin.Name); } } diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs old mode 100644 new mode 100755 index 98ef5d5..5a3b814 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -528,7 +528,7 @@ namespace OpenSim.Framework { while (name.Trim() == string.Empty) { - name = MainConsole.Instance.CmdPrompt("New region name", name); + name = MainConsole.Instance.Prompt("New region name", name); if (name.Trim() == string.Empty) { MainConsole.Instance.Output("Cannot interactively create region with no name"); @@ -570,7 +570,7 @@ namespace OpenSim.Framework UUID newID = UUID.Random(); while (RegionID == UUID.Zero) { - regionUUID = MainConsole.Instance.CmdPrompt("RegionUUID", newID.ToString()); + regionUUID = MainConsole.Instance.Prompt("RegionUUID", newID.ToString()); if (!UUID.TryParse(regionUUID.Trim(), out RegionID)) { MainConsole.Instance.Output("RegionUUID must be a valid UUID"); @@ -587,7 +587,7 @@ namespace OpenSim.Framework string location = config.GetString("Location", String.Empty); if (location == String.Empty) { - location = MainConsole.Instance.CmdPrompt("Region Location", "1000,1000"); + location = MainConsole.Instance.Prompt("Region Location", "1000,1000"); config.Set("Location", location); } @@ -623,7 +623,7 @@ namespace OpenSim.Framework } else { - address = IPAddress.Parse(MainConsole.Instance.CmdPrompt("Internal IP address", "0.0.0.0")); + address = IPAddress.Parse(MainConsole.Instance.Prompt("Internal IP address", "0.0.0.0")); config.Set("InternalAddress", address.ToString()); } @@ -637,7 +637,7 @@ namespace OpenSim.Framework } else { - port = Convert.ToInt32(MainConsole.Instance.CmdPrompt("Internal port", "9000")); + port = Convert.ToInt32(MainConsole.Instance.Prompt("Internal port", "9000")); config.Set("InternalPort", port); } m_internalEndPoint = new IPEndPoint(address, port); @@ -652,7 +652,7 @@ namespace OpenSim.Framework else { if (creatingNew) - m_resolveAddress = Convert.ToBoolean(MainConsole.Instance.CmdPrompt("Resolve hostname to IP on start (for running inside Docker)", "False")); + m_resolveAddress = Convert.ToBoolean(MainConsole.Instance.Prompt("Resolve hostname to IP on start (for running inside Docker)", "False")); config.Set("ResolveAddress", m_resolveAddress.ToString()); } @@ -667,7 +667,7 @@ namespace OpenSim.Framework } else { - externalName = MainConsole.Instance.CmdPrompt("External host name", "SYSTEMIP"); + externalName = MainConsole.Instance.Prompt("External host name", "SYSTEMIP"); config.Set("ExternalHostName", externalName); } if (externalName == "SYSTEMIP") diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs old mode 100644 new mode 100755 index 48a3a82..f4662fe --- a/OpenSim/Framework/Servers/MainServer.cs +++ b/OpenSim/Framework/Servers/MainServer.cs @@ -192,35 +192,35 @@ namespace OpenSim.Framework.Servers if (!int.TryParse(rawNewDebug, out newDebug)) { - MainConsole.Instance.OutputFormat("{0} is not a valid debug level", rawNewDebug); + MainConsole.Instance.Output("{0} is not a valid debug level", null, rawNewDebug); return; } if (newDebug < 0 || newDebug > 6) { - MainConsole.Instance.OutputFormat("{0} is outside the valid debug level range of 0..6", newDebug); + MainConsole.Instance.Output("{0} is outside the valid debug level range of 0..6", null, newDebug); return; } if (allReqs || inReqs) { MainServer.DebugLevel = newDebug; - MainConsole.Instance.OutputFormat("IN debug level set to {0}", newDebug); + MainConsole.Instance.Output("IN debug level set to {0}", null, newDebug); } if (allReqs || outReqs) { WebUtil.DebugLevel = newDebug; - MainConsole.Instance.OutputFormat("OUT debug level set to {0}", newDebug); + MainConsole.Instance.Output("OUT debug level set to {0}", null, newDebug); } } else { if (allReqs || inReqs) - MainConsole.Instance.OutputFormat("Current IN debug level is {0}", MainServer.DebugLevel); + MainConsole.Instance.Output("Current IN debug level is {0}", null, DebugLevel); if (allReqs || outReqs) - MainConsole.Instance.OutputFormat("Current OUT debug level is {0}", WebUtil.DebugLevel); + MainConsole.Instance.Output("Current OUT debug level is {0}", null, WebUtil.DebugLevel); } } diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs old mode 100644 new mode 100755 index 858098c..78341d4 --- a/OpenSim/Framework/Servers/ServerBase.cs +++ b/OpenSim/Framework/Servers/ServerBase.cs @@ -492,18 +492,18 @@ namespace OpenSim.Framework.Servers if (!int.TryParse(rawLevel, out newLevel)) { - MainConsole.Instance.OutputFormat("{0} is not a valid debug level", rawLevel); + MainConsole.Instance.Output("{0} is not a valid debug level", null, rawLevel); return; } if (newLevel < 0 || newLevel > Util.MAX_THREADPOOL_LEVEL) { - MainConsole.Instance.OutputFormat("{0} is outside the valid debug level range of 0.." + Util.MAX_THREADPOOL_LEVEL, newLevel); + MainConsole.Instance.Output("{0} is outside the valid debug level range of 0.." + Util.MAX_THREADPOOL_LEVEL, null, newLevel); return; } Util.LogThreadPool = newLevel; - MainConsole.Instance.OutputFormat("LogThreadPool set to {0}", newLevel); + MainConsole.Instance.Output("LogThreadPool set to {0}", null, newLevel); } private void HandleForceGc(string module, string[] args) @@ -991,9 +991,9 @@ namespace OpenSim.Framework.Servers } if (Watchdog.AbortThread(threadId)) - MainConsole.Instance.OutputFormat("Aborted thread with id {0}", threadId); + MainConsole.Instance.Output("Aborted thread with id {0}", null, threadId); else - MainConsole.Instance.OutputFormat("ERROR - Thread with id {0} not found in managed threads", threadId); + MainConsole.Instance.Output("ERROR - Thread with id {0} not found in managed threads", null, threadId); } /// @@ -1020,7 +1020,7 @@ namespace OpenSim.Framework.Servers protected void Notice(string format, params object[] components) { if (m_console != null) - m_console.OutputFormat(format, components); + m_console.Output(format, null, components); } public virtual void Shutdown() -- cgit v1.1