fix double login issue and oobe bugs

This commit is contained in:
Michael 2017-05-28 16:05:51 -04:00
parent c7ba7d733c
commit e85832a5a4
2 changed files with 6 additions and 2 deletions

View file

@ -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));

View file

@ -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<Save>(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
/// </summary>
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
}
/// <summary>