mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-22 18:02:16 +00:00
Fix a bug with command-line login.
This commit is contained in:
parent
e841b168e1
commit
dc0b8c6688
2 changed files with 13 additions and 2 deletions
|
@ -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];
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue