From 5fbf30dbc0350fe805686e4299604225f5bc4739 Mon Sep 17 00:00:00 2001 From: william341 Date: Sat, 6 May 2017 17:27:39 -0700 Subject: [PATCH] fixed textlogin --- ShiftOS_TheReturn/SaveSystem.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ShiftOS_TheReturn/SaveSystem.cs b/ShiftOS_TheReturn/SaveSystem.cs index 1f2532a..e635a7a 100644 --- a/ShiftOS_TheReturn/SaveSystem.cs +++ b/ShiftOS_TheReturn/SaveSystem.cs @@ -307,9 +307,9 @@ namespace ShiftOS.Engine { string loginstr = CurrentSave.SystemName + " login: "; string getuser = text.Remove(0, loginstr.Length); - if (CurrentSave.Users.FirstOrDefault(x => x.Username == getuser) == null) + if (!string.IsNullOrWhiteSpace(getuser)) { - if (CurrentSave.Users.FirstOrDefault(x => x.Username == text) == null) + if (CurrentSave.Users.FirstOrDefault(x => x.Username == getuser) == null) { Console.WriteLine("User not found."); goback = true; @@ -317,7 +317,7 @@ namespace ShiftOS.Engine TerminalBackend.TextSent -= ev; return; } - username = text; + username = getuser; progress++; } else @@ -327,13 +327,13 @@ namespace ShiftOS.Engine goback = true; progress++; } - username = getuser; - progress++; } else if (progress == 1) { + string passwordstr = "password: "; + string getpass = text.Remove(0, passwordstr.Length); var user = CurrentSave.Users.FirstOrDefault(x => x.Username == username); - if (user.Password == text) + if (user.Password == getpass) { Console.WriteLine("Welcome to ShiftOS."); CurrentUser = user;