diff options
| author | Michael <[email protected]> | 2017-04-28 20:01:04 -0400 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-04-28 20:01:04 -0400 |
| commit | 712d38a2be53b415c2635b86e1f539faec0ace19 (patch) | |
| tree | f600fea9f8f98a715216a98100f047846b693faa /ShiftOS.WinForms/Oobe.cs | |
| parent | e1b3ecc57d42a961c780114e4e582a875e8f3b96 (diff) | |
| download | shiftos_thereturn-712d38a2be53b415c2635b86e1f539faec0ace19.tar.gz shiftos_thereturn-712d38a2be53b415c2635b86e1f539faec0ace19.tar.bz2 shiftos_thereturn-712d38a2be53b415c2635b86e1f539faec0ace19.zip | |
Final Beta 2.3 adjustments.
Diffstat (limited to 'ShiftOS.WinForms/Oobe.cs')
| -rw-r--r-- | ShiftOS.WinForms/Oobe.cs | 52 |
1 files changed, 42 insertions, 10 deletions
diff --git a/ShiftOS.WinForms/Oobe.cs b/ShiftOS.WinForms/Oobe.cs index 5b767e0..6017d35 100644 --- a/ShiftOS.WinForms/Oobe.cs +++ b/ShiftOS.WinForms/Oobe.cs @@ -221,18 +221,50 @@ You must join the digital society, rise up the ranks, and save us. public void PromptForLogin() { - this.Show(); - this.TopMost = true; - lblHijack.Text = ""; - textgeninput = lblhackwords; - - var fsw = new FakeSetupScreen(this, 10); - fsw.Show(); - fsw.TopMost = true; - fsw.DoneLoggingIn += () => + ServerMessageReceived MessageReceived = null; + MessageReceived = (msg) => { - this.Close(); + if(msg.Name == "mud_savefile") + { + SaveSystem.CurrentSave = JsonConvert.DeserializeObject<Save>(msg.Contents); + SaveSystem.SaveGame(); + Application.Restart(); + } + else if(msg.Name == "mud_notfound") + { + ServerManager.MessageReceived -= MessageReceived; + + PromptForLogin(); + } }; + ServerManager.MessageReceived += MessageReceived; + Infobox.PromptYesNo("Login", "You are missing a digital society authentication link. Would you like to generate a new link with an existing account? Choosing \"No\" will restart the session in the out-of-box experience.", (result)=> + { + if (result == true) + { + Infobox.PromptText("Login", "Please enter your digital society username.", (uname) => + { + Infobox.PromptText("Login", "Please enter your password.", (pword) => + { + ServerManager.SendMessage("mud_login", JsonConvert.SerializeObject(new + { + username = uname, + password = pword + })); + }, true); + }); + } + else + { + //restart in OOBE + if (Objects.ShiftFS.Utils.FileExists(Paths.GetPath("user.dat"))) + { + Utils.Delete(Paths.GetPath("user.dat")); + } + Application.Restart(); + } + }); + } public void StartTrailer() |
