a few changes to local console; add pooling of Console.KeyAvailable instead of waiting on keyread, that has treading issues. Thanks ALicia for some ideas on this

This commit is contained in:
UbitUmarov
2022-09-18 05:21:07 +01:00
parent 0505fd54e4
commit 87ba2d7b43
5 changed files with 87 additions and 93 deletions

View File

@@ -91,14 +91,13 @@ namespace OpenSim.Framework.Console
public virtual void Output(string format, params object[] components)
{
string level = null;
//string level = null;
if (components != null && components.Length > 0)
{
if (components[0] == null || components[0] is ConsoleLevel)
ConsoleLevel cl = components[0] as ConsoleLevel;
if (cl != null)
{
if (components[0] is ConsoleLevel)
level = ((ConsoleLevel)components[0]).ToString();
//level = cl.ToString();
if (components.Length > 1)
{
object[] tmp = new object[components.Length - 1];
@@ -108,13 +107,9 @@ namespace OpenSim.Framework.Console
else
components = null;
}
}
string text;
if (components == null || components.Length == 0)
text = format;
else
text = String.Format(format, components);
string text = (components == null || components.Length == 0) ? format : String.Format(format, components);
System.Console.WriteLine(text);
}