fix mud.connect deadlock

This commit is contained in:
Michael 2017-03-11 10:28:16 -05:00
parent dad61e325c
commit 01420ff329
4 changed files with 35 additions and 29 deletions

View file

@ -158,8 +158,7 @@ namespace ShiftOS.WinForms
int tutPos = 0;
Action ondec = () =>
{
if (tutPos == 2)
tutPos++;
tutPos++;
};
TerminalBackend.CommandProcessed += (o, a) =>
{

View file

@ -156,6 +156,8 @@ namespace ShiftOS.Engine
{
Console.WriteLine("{ERROR}: " + ex.Message);
}
TerminalBackend.PrefixEnabled = false;
return true;
}
catch (Exception ex)

View file

@ -125,6 +125,8 @@ namespace ShiftOS.Engine
{
thisGuid = new Guid(msg.Contents);
GUIDReceived?.Invoke(msg.Contents);
TerminalBackend.PrefixEnabled = true;
TerminalBackend.PrintPrompt();
}
else if(msg.Name == "allusers")
{

View file

@ -339,35 +339,38 @@ namespace ShiftOS.Engine
public static void PrintPrompt()
{
ConsoleEx.BackgroundColor = SkinEngine.LoadedSkin.TerminalBackColorCC;
ConsoleEx.Italic = false;
ConsoleEx.Underline = false;
if (SaveSystem.CurrentSave != null)
{
ConsoleEx.BackgroundColor = SkinEngine.LoadedSkin.TerminalBackColorCC;
ConsoleEx.Italic = false;
ConsoleEx.Underline = false;
ConsoleEx.ForegroundColor = ConsoleColor.Magenta;
ConsoleEx.Bold = true;
ConsoleEx.ForegroundColor = ConsoleColor.Magenta;
ConsoleEx.Bold = true;
Console.Write(SaveSystem.CurrentSave.Username);
ConsoleEx.Bold = false;
ConsoleEx.ForegroundColor = ConsoleColor.Gray;
Console.Write("@");
ConsoleEx.Italic = true;
ConsoleEx.Bold = true;
ConsoleEx.ForegroundColor = ConsoleColor.Yellow;
Console.Write(SaveSystem.CurrentSave.SystemName);
ConsoleEx.Italic = false;
ConsoleEx.Bold = false;
ConsoleEx.ForegroundColor = ConsoleColor.Gray;
Console.Write(":~");
Console.ForegroundColor = ConsoleColor.White;
ConsoleEx.Italic = true;
if (KernelWatchdog.InKernelMode == true)
Console.Write("#");
else
Console.Write("$");
ConsoleEx.Italic = false;
ConsoleEx.Bold = false;
ConsoleEx.ForegroundColor = SkinEngine.LoadedSkin.TerminalForeColorCC;
Console.Write(" ");
Console.Write(SaveSystem.CurrentSave.Username);
ConsoleEx.Bold = false;
ConsoleEx.ForegroundColor = ConsoleColor.Gray;
Console.Write("@");
ConsoleEx.Italic = true;
ConsoleEx.Bold = true;
ConsoleEx.ForegroundColor = ConsoleColor.Yellow;
Console.Write(SaveSystem.CurrentSave.SystemName);
ConsoleEx.Italic = false;
ConsoleEx.Bold = false;
ConsoleEx.ForegroundColor = ConsoleColor.Gray;
Console.Write(":~");
Console.ForegroundColor = ConsoleColor.White;
ConsoleEx.Italic = true;
if (KernelWatchdog.InKernelMode == true)
Console.Write("#");
else
Console.Write("$");
ConsoleEx.Italic = false;
ConsoleEx.Bold = false;
ConsoleEx.ForegroundColor = SkinEngine.LoadedSkin.TerminalForeColorCC;
Console.Write(" ");
}
}