From dc0b8c66885593f7412e24bf7132bc08f6c40a9c Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 28 May 2017 06:44:58 -0400 Subject: [PATCH] Fix a bug with command-line login. --- ShiftOS.WinForms/Applications/Terminal.cs | 7 +++++++ ShiftOS_TheReturn/SaveSystem.cs | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ShiftOS.WinForms/Applications/Terminal.cs b/ShiftOS.WinForms/Applications/Terminal.cs index ea24686..4cd4806 100644 --- a/ShiftOS.WinForms/Applications/Terminal.cs +++ b/ShiftOS.WinForms/Applications/Terminal.cs @@ -269,6 +269,13 @@ namespace ShiftOS.WinForms.Applications try { a.SuppressKeyPress = true; + if (!TerminalBackend.PrefixEnabled) + { + string textraw = txt.Lines[txt.Lines.Length - 1]; + TextSent?.Invoke(textraw); + TerminalBackend.SendText(textraw); + return; + } Console.WriteLine(""); var text = txt.Lines.ToArray(); var text2 = text[text.Length - 2]; diff --git a/ShiftOS_TheReturn/SaveSystem.cs b/ShiftOS_TheReturn/SaveSystem.cs index d74006a..f3d95be 100644 --- a/ShiftOS_TheReturn/SaveSystem.cs +++ b/ShiftOS_TheReturn/SaveSystem.cs @@ -349,6 +349,7 @@ namespace ShiftOS.Engine { if (CurrentSave.Users.FirstOrDefault(x => x.Username == getuser) == null) { + Console.WriteLine(); Console.WriteLine("User not found."); goback = true; progress++; @@ -360,6 +361,7 @@ namespace ShiftOS.Engine } else { + Console.WriteLine(); Console.WriteLine("Username not provided."); TerminalBackend.TextSent -= ev; goback = true; @@ -373,13 +375,14 @@ namespace ShiftOS.Engine var user = CurrentSave.Users.FirstOrDefault(x => x.Username == username); if (user.Password == getpass) { + Console.WriteLine(); Console.WriteLine("Welcome to ShiftOS."); CurrentUser = user; - Thread.Sleep(2000); progress++; } else { + Console.WriteLine(); Console.WriteLine("Access denied."); goback = true; progress++; @@ -388,7 +391,7 @@ namespace ShiftOS.Engine } }; TerminalBackend.TextSent += ev; - + Console.WriteLine(); Console.Write(CurrentSave.SystemName + " login: "); while (progress == 0) { @@ -396,6 +399,7 @@ namespace ShiftOS.Engine } if (goback) goto Login; + Console.WriteLine(); Console.Write("password: "); while (progress == 1) Thread.Sleep(10);