Fix login bugs related to #71 .

This commit is contained in:
Michael 2017-02-23 15:41:22 -05:00
parent 750b776349
commit ad76a525fe
2 changed files with 65 additions and 47 deletions

View file

@ -250,6 +250,7 @@ So make sure your password is secure enough that it can't be guessed, but easy f
{
SaveSystem.CurrentSave = JsonConvert.DeserializeObject<ShiftOS.Objects.Save>(msg.Contents);
SaveSystem.SaveGame();
CreateNewSave = false;
DoneLoggingIn?.Invoke();
this.CanClose = true;
this.Close();
@ -281,6 +282,8 @@ So make sure your password is secure enough that it can't be guessed, but easy f
public event Action DoneLoggingIn;
public bool CreateNewSave = true;
public event Action<string, string, string> UserReregistered;
public void StartWipingInBackground(long arbitraryAmountOfBytes)

View file

@ -88,6 +88,7 @@ namespace ShiftOS.WinForms
slashcount++;
if (slashcount == 5)
slashcount = 1;
Thread.Sleep(50);
}
rtext += Environment.NewLine;
typing = false;
@ -164,54 +165,68 @@ namespace ShiftOS.WinForms
{
Thread.Sleep(10);
}
TextType("That's all the information I need for now.");
Thread.Sleep(2000);
TextType("Beginning installation of ShiftOS on " + MySave.SystemName + ".");
Thread.Sleep(500);
TextType("Creating new user: " + MySave.Username);
TextType("...with 0 Codepoints, 0 installed upgrades, no legion, and no user shops...");
MySave.Codepoints = 0;
MySave.CurrentLegions = new List<string>();
MySave.MyShop = "";
TextType("User created successfully.");
Thread.Sleep(450);
TextType("You may be wondering what all that meant... You see, in ShiftOS, your user account holds everything I need to know about you.");
Thread.Sleep(640);
TextType("It holds the amount of Codepoints you have - Codepoints are a special currency you can get by doing various tasks in ShiftOS.");
Thread.Sleep(500);
TextType("It also holds all the upgrades you've installed onto ShiftOS - features, applications, enhancements, patches, all that stuff.");
Thread.Sleep(500);
TextType("As for the legions and the shop thing, I'll reveal that to you when it becomes necessary.");
Thread.Sleep(500);
TextType("Your user account is stored on a server of mine called the multi-user domain. It holds every single user account, every script, every application, every thing within ShiftOS.");
Thread.Sleep(600);
TextType("Every time you boot ShiftOS, if you are connected to the Internet, you will immediately connect to the multi-user domain and ShiftOS will attempt to authenticate using the last ");
TextType("successful username and password pair.");
Thread.Sleep(500);
TextType("When you are in the MUD, you are in the middle of a free-for-all. I don't want it to be this way, it just is. I've employed you to help me develop and test the MUD and ShiftOS, ");
TextType("but you have a secondary task if you choose to accept it.");
Thread.Sleep(500);
TextType("There have been a few rebelious groups in the MUD - who have cracked ShiftOS's security barriers - and they're using these exploits to steal others' Codepoints, upgrades, ");
TextType("and even spread damaging viruses.");
Thread.Sleep(500);
TextType("I want you to stop them.");
Thread.Sleep(500);
TextType("Whoever can stop these hackers will gain eternal control over the multi-user domain. They will be given the ability to do as they please, so long as it doesn't interfere with my experiments.");
Thread.Sleep(500);
TextType("I have been installing ShiftOS on your system in the background as I was talking with you. Before I can set you free, I need to give you a tutorial on how to use the system.");
Thread.Sleep(500);
TextType("I will reboot your system in Tutorial Mode now. Complete the tutorial, and you shall be on your way.");
Thread.Sleep(3000);
SaveSystem.CurrentSave = MySave;
SaveSystem.CurrentSave.StoryPosition = 1;
Utils.WriteAllText(Paths.GetPath("user.dat"), JsonConvert.SerializeObject(new
if (fakeForm.CreateNewSave == true)
{
username = MySave.Username,
password = MySave.Password
}));
Shiftorium.Silent = true;
SaveSystem.SaveGame(); //Yknow, just incase it crashes.
TextType("That's all the information I need for now.");
Thread.Sleep(2000);
TextType("Beginning installation of ShiftOS on " + MySave.SystemName + ".");
Thread.Sleep(500);
TextType("Creating new user: " + MySave.Username);
TextType("...with 0 Codepoints, 0 installed upgrades, no legion, and no user shops...");
MySave.Codepoints = 0;
MySave.CurrentLegions = new List<string>();
MySave.MyShop = "";
TextType("User created successfully.");
Thread.Sleep(450);
TextType("You may be wondering what all that meant... You see, in ShiftOS, your user account holds everything I need to know about you.");
Thread.Sleep(640);
TextType("It holds the amount of Codepoints you have - Codepoints are a special currency you can get by doing various tasks in ShiftOS.");
Thread.Sleep(500);
TextType("It also holds all the upgrades you've installed onto ShiftOS - features, applications, enhancements, patches, all that stuff.");
Thread.Sleep(500);
TextType("As for the legions and the shop thing, I'll reveal that to you when it becomes necessary.");
Thread.Sleep(500);
TextType("Your user account is stored on a server of mine called the multi-user domain. It holds every single user account, every script, every application, every thing within ShiftOS.");
Thread.Sleep(600);
TextType("Every time you boot ShiftOS, if you are connected to the Internet, you will immediately connect to the multi-user domain and ShiftOS will attempt to authenticate using the last ");
TextType("successful username and password pair.");
Thread.Sleep(500);
TextType("When you are in the MUD, you are in the middle of a free-for-all. I don't want it to be this way, it just is. I've employed you to help me develop and test the MUD and ShiftOS, ");
TextType("but you have a secondary task if you choose to accept it.");
Thread.Sleep(500);
TextType("There have been a few rebelious groups in the MUD - who have cracked ShiftOS's security barriers - and they're using these exploits to steal others' Codepoints, upgrades, ");
TextType("and even spread damaging viruses.");
Thread.Sleep(500);
TextType("I want you to stop them.");
Thread.Sleep(500);
TextType("Whoever can stop these hackers will gain eternal control over the multi-user domain. They will be given the ability to do as they please, so long as it doesn't interfere with my experiments.");
Thread.Sleep(500);
TextType("I have been installing ShiftOS on your system in the background as I was talking with you. Before I can set you free, I need to give you a tutorial on how to use the system.");
Thread.Sleep(500);
TextType("I will reboot your system in Tutorial Mode now. Complete the tutorial, and you shall be on your way.");
Thread.Sleep(3000);
SaveSystem.CurrentSave = MySave;
SaveSystem.CurrentSave.StoryPosition = 1;
Utils.WriteAllText(Paths.GetPath("user.dat"), JsonConvert.SerializeObject(new
{
username = MySave.Username,
password = MySave.Password
}));
Shiftorium.Silent = true;
SaveSystem.SaveGame(); //Yknow, just incase it crashes.
}
else
{
TextType("Your login attempt was successful, " + SaveSystem.CurrentSave.Username + ".");
Thread.Sleep(500);
TextType($"According to my data on you, you have earned {SaveSystem.CurrentSave.Codepoints} Codepoints so far.");
Thread.Sleep(500);
TextType($"You have also acquired {SaveSystem.CurrentSave.CountUpgrades()} Shiftorium upgrades out of the {SaveSystem.CurrentSave.Upgrades.Count} available.");
Thread.Sleep(500);
TextType("I will now let you proceed to your system.");
Thread.Sleep(1000);
}
this.Invoke(new Action(this.Close));
}
catch (Exception e)