Fix Shiftorium init bug.

This commit is contained in:
Michael 2017-06-10 12:58:09 -04:00
parent c40d071d58
commit 920e33a2fd
2 changed files with 24 additions and 18 deletions

View file

@ -59,6 +59,7 @@ namespace ShiftOS.WinForms
};
Localization.RegisterProvider(new WFLanguageProvider());
Infobox.Init(new Dialog());
LoginManager.Init(new WinForms.GUILoginFrontend());
FileSkimmerBackend.Init(new WinformsFSFrontend());
var desk = new WinformsDesktop();
Desktop.Init(desk);

View file

@ -307,6 +307,8 @@ namespace ShiftOS.Engine
Thread.Sleep(10);
}
Shiftorium.Init();
while (CurrentSave.StoryPosition < 1)
{
Thread.Sleep(10);
@ -633,27 +635,30 @@ namespace ShiftOS.Engine
/// </summary>
public static void SaveGame()
{
#if !NOSAVE
if(!Shiftorium.Silent)
Console.WriteLine("");
if(!Shiftorium.Silent)
Console.Write("{SE_SAVING}... ");
if (SaveSystem.CurrentSave != null)
if (IsSandbox == false)
{
Utils.WriteAllText(Paths.GetPath("user.dat"), CurrentSave.UniteAuthToken);
var serialisedSaveFile = JsonConvert.SerializeObject(CurrentSave, Formatting.Indented);
new Thread(() =>
#if !NOSAVE
if (!Shiftorium.Silent)
Console.WriteLine("");
if (!Shiftorium.Silent)
Console.Write("{SE_SAVING}... ");
if (SaveSystem.CurrentSave != null)
{
// please don't do networking on the main thread if you're just going to
// discard the response, it's extremely slow
ServerManager.SendMessage("mud_save", serialisedSaveFile);
})
{ IsBackground = false }.Start();
}
if (!Shiftorium.Silent)
Console.WriteLine(" ...{DONE}.");
System.IO.File.WriteAllText(Paths.SaveFile, Utils.ExportMount(0));
Utils.WriteAllText(Paths.GetPath("user.dat"), CurrentSave.UniteAuthToken);
var serialisedSaveFile = JsonConvert.SerializeObject(CurrentSave, Formatting.Indented);
new Thread(() =>
{
// please don't do networking on the main thread if you're just going to
// discard the response, it's extremely slow
ServerManager.SendMessage("mud_save", serialisedSaveFile);
})
{ IsBackground = false }.Start();
}
if (!Shiftorium.Silent)
Console.WriteLine(" ...{DONE}.");
System.IO.File.WriteAllText(Paths.SaveFile, Utils.ExportMount(0));
#endif
}
}
/// <summary>