From e85832a5a4caefe854f3f27b7e60663e2bf26624 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 28 May 2017 16:05:51 -0400 Subject: [PATCH] fix double login issue and oobe bugs --- ShiftOS.WinForms/OobeStory.cs | 2 ++ ShiftOS_TheReturn/SaveSystem.cs | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ShiftOS.WinForms/OobeStory.cs b/ShiftOS.WinForms/OobeStory.cs index a35e1d8..8d86b9e 100644 --- a/ShiftOS.WinForms/OobeStory.cs +++ b/ShiftOS.WinForms/OobeStory.cs @@ -111,6 +111,7 @@ namespace ShiftOS.WinForms ConsoleEx.Bold = false; ConsoleEx.BackgroundColor = ConsoleColor.Black; Console.Write("Formatting: ["); + ConsoleEx.OnFlush?.Invoke(); int formatProgress = 3; while (formatProgress <= 100) { @@ -118,6 +119,7 @@ namespace ShiftOS.WinForms { ConsoleEx.BackgroundColor = ConsoleColor.White; Console.Write(" "); + ConsoleEx.OnFlush?.Invoke(); ConsoleEx.BackgroundColor = ConsoleColor.Black; } Desktop.InvokeOnWorkerThread(() => Engine.AudioManager.PlayStream(Properties.Resources.typesound)); diff --git a/ShiftOS_TheReturn/SaveSystem.cs b/ShiftOS_TheReturn/SaveSystem.cs index 55f5cd5..c8996d4 100644 --- a/ShiftOS_TheReturn/SaveSystem.cs +++ b/ShiftOS_TheReturn/SaveSystem.cs @@ -21,6 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ +// #define NOSAVE //#define ONLINEMODE @@ -213,15 +214,14 @@ namespace ShiftOS.Engine savehandshake = (msg) => { + ServerManager.MessageReceived -= savehandshake; if (msg.Name == "mud_savefile") { CurrentSave = JsonConvert.DeserializeObject(msg.Contents); - ServerManager.MessageReceived -= savehandshake; } else if (msg.Name == "mud_login_denied") { oobe.PromptForLogin(); - ServerManager.MessageReceived -= savehandshake; } }; ServerManager.MessageReceived += savehandshake; @@ -554,6 +554,7 @@ namespace ShiftOS.Engine /// public static void SaveGame() { +#if !NOSAVE if(!Shiftorium.Silent) Console.WriteLine(""); if(!Shiftorium.Silent) @@ -566,6 +567,7 @@ namespace ShiftOS.Engine if (!Shiftorium.Silent) Console.WriteLine(" ...{DONE}."); System.IO.File.WriteAllText(Paths.SaveFile, Utils.ExportMount(0)); +#endif } ///