aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms/Oobe.cs
diff options
context:
space:
mode:
authorwilliam341 <[email protected]>2017-06-18 16:43:30 -0700
committerGitHub <[email protected]>2017-06-18 16:43:30 -0700
commitba80dcf3f80018cbb041b62ad8a40268427d1311 (patch)
treef0bd18b2355d34c07c744c3cd82a4725a799eecd /ShiftOS.WinForms/Oobe.cs
parent771c20cfb3a703e0f1550fdcf9eb07b78298c944 (diff)
parent12acff8742f4c64976bfabee1b70dc515190fc7c (diff)
downloadshiftos_thereturn-ba80dcf3f80018cbb041b62ad8a40268427d1311.tar.gz
shiftos_thereturn-ba80dcf3f80018cbb041b62ad8a40268427d1311.tar.bz2
shiftos_thereturn-ba80dcf3f80018cbb041b62ad8a40268427d1311.zip
Merge pull request #2 from shiftos-game/master
wew
Diffstat (limited to 'ShiftOS.WinForms/Oobe.cs')
-rw-r--r--ShiftOS.WinForms/Oobe.cs132
1 files changed, 7 insertions, 125 deletions
diff --git a/ShiftOS.WinForms/Oobe.cs b/ShiftOS.WinForms/Oobe.cs
index 90395a7..b2f8cd2 100644
--- a/ShiftOS.WinForms/Oobe.cs
+++ b/ShiftOS.WinForms/Oobe.cs
@@ -91,6 +91,7 @@ namespace ShiftOS.WinForms
slashcount++;
if (slashcount == 5)
slashcount = 1;
+ Engine.AudioManager.PlayStream(Properties.Resources.writesound);
Thread.Sleep(50);
}
rtext += Environment.NewLine;
@@ -138,7 +139,10 @@ namespace ShiftOS.WinForms
TextType("Your computer has been taken over by ShiftOS, and is currently being wiped clean of all existing files and programs.");
Thread.Sleep(2000);
Clear();
- TextType("I will not share my identity or my intentions at this moment.I will just proceed with the installation.There�s nothing you can do to stop it.");
+ TextType("I will not share my identity or my intentions at this moment.");
+ Thread.Sleep(2000);
+ Clear();
+ TextType("I will just proceed with the installation.There�s nothing you can do to stop it.");
Thread.Sleep(2000);
Clear();
TextType("All I will say, is I need your help.Once ShiftOS is installed, I will explain.");
@@ -190,136 +194,14 @@ namespace ShiftOS.WinForms
}
+ [Obsolete("Unite code stub.")]
public void PromptForLogin()
{
- Infobox.Show("Login", "Since the last time you've played ShiftOS, some changes have been made to the login system. You must now login using your website credentials.", () =>
- {
- Infobox.PromptYesNo("Website account", "Do you have an account at http://getshiftos.ml?", (hasAccount) =>
- {
- if(hasAccount == true)
- {
- var loginDialog = new UniteLoginDialog((success)=>
- {
- string token = success;
- var uClient = new UniteClient("http://getshiftos.ml", token);
- Infobox.Show("Welcome to ShiftOS.", $"Hello, {uClient.GetDisplayName()}! We've signed you into your account. We'll now try to link your ShiftOS account with your save file.", () =>
- {
- ServerMessageReceived smr = null;
- smr = (msg) =>
- {
- ServerManager.MessageReceived -= smr;
- if (msg.Name == "mud_savefile")
- {
- SaveSystem.CurrentSave = JsonConvert.DeserializeObject<Save>(msg.Contents);
- SaveSystem.SaveGame();
- }
- else if(msg.Name=="mud_login_denied")
- {
- LinkSaveFile(token);
- }
- };
- ServerManager.MessageReceived += smr;
- ServerManager.SendMessage("mud_token_login", token);
- });
- });
- AppearanceManager.SetupDialog(loginDialog);
- }
- else
- {
- var signupDialog = new UniteSignupDialog((token) =>
- {
- ServerMessageReceived smr = null;
- smr = (msg) =>
- {
- ServerManager.MessageReceived -= smr;
- if (msg.Name == "mud_savefile")
- {
- SaveSystem.CurrentSave = JsonConvert.DeserializeObject<Save>(msg.Contents);
- SaveSystem.SaveGame();
- }
- else if (msg.Name == "mud_login_denied")
- {
- LinkSaveFile(token);
- }
- };
- ServerManager.MessageReceived += smr;
- ServerManager.SendMessage("mud_token_login", token);
-
- });
- AppearanceManager.SetupDialog(signupDialog);
- }
- });
- });
}
+ [Obsolete("Unite code stub.")]
public void LinkSaveFile(string token)
{
- if (Utils.FileExists(Paths.GetPath("user.dat")))
- {
- try
- {
- var details = JsonConvert.DeserializeObject<ClientSave>(Utils.ReadAllText(Paths.GetPath("user.dat")));
- ServerMessageReceived smr = null;
- bool msgreceived = false;
- bool found = false;
- smr = (msg) =>
- {
- if (msg.Name == "mud_savefile")
- {
- var save = JsonConvert.DeserializeObject<Save>(msg.Contents);
- save.UniteAuthToken = token;
- Infobox.Show("Migration complete.", "We have migrated your old save file to the new system successfully. You can still log in using the old system on old builds of ShiftOS.", () =>
- {
- SaveSystem.CurrentSave = save;
- SaveSystem.SaveGame();
- found = true;
- msgreceived = true;
- });
- }
- else if (msg.Name == "mud_login_denied")
- {
- found = false;
- msgreceived = true;
- }
- ServerManager.MessageReceived -= smr;
- };
- ServerManager.MessageReceived += smr;
- ServerManager.SendMessage("mud_login", JsonConvert.SerializeObject(new
- {
- username = details.Username,
- password = details.Password
- }));
- while (msgreceived == false)
- Thread.Sleep(10);
- if (found == true)
- return;
- }
- catch
- {
-
- }
- }
-
- var client = new UniteClient("http://getshiftos.ml", token);
- var sve = new Save();
- SaveSystem.CurrentUser.Username = client.GetEmail();
- sve.Password = Guid.NewGuid().ToString();
- sve.SystemName = client.GetSysName();
- sve.UniteAuthToken = token;
- sve.Codepoints = 0;
- sve.Upgrades = new Dictionary<string, bool>();
- sve.ID = Guid.NewGuid();
- sve.StoriesExperienced = new List<string>();
- sve.StoriesExperienced.Add("mud_fundamentals");
- Infobox.Show("Welcome to ShiftOS.", "Welcome to ShiftOS, " + client.GetDisplayName() + ". We have created a save file for you. Now, go on and Shift It Your Way.", () =>
- {
- sve.StoryPosition = 8675309;
- SaveSystem.CurrentSave = sve;
- Shiftorium.Silent = true;
- SaveSystem.SaveGame();
- Shiftorium.Silent = false;
-
- });
}
public void ForceReboot()