mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-22 18:02:16 +00:00
Let's try that again........
seems like I somehow got an old copy of SaveSystem.cs and committed that, re-introducing the game's dependency on Unite, which is dead, press F to pay respects.
This commit is contained in:
parent
d1538e742b
commit
428533fec2
1 changed files with 41 additions and 47 deletions
|
@ -79,7 +79,6 @@ namespace ShiftOS.Engine
|
|||
/// </summary>
|
||||
public static Save CurrentSave { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Start the entire ShiftOS engine.
|
||||
/// </summary>
|
||||
|
@ -105,8 +104,6 @@ namespace ShiftOS.Engine
|
|||
|
||||
Localization.SetupTHETRUEDefaultLocals();
|
||||
SkinEngine.Init();
|
||||
Random rnd = new Random();
|
||||
int loadingJoke1 = rnd.Next(5);
|
||||
|
||||
TerminalBackend.OpenTerminal();
|
||||
|
||||
|
@ -141,19 +138,7 @@ namespace ShiftOS.Engine
|
|||
Console.WriteLine("[sfs] Loading SFS driver v3");
|
||||
Thread.Sleep(100);
|
||||
Console.WriteLine("[sfs] 4096 blocks read.");
|
||||
if (loadingJoke1 == 0)
|
||||
Console.WriteLine("[sos] Getting good and ready...");
|
||||
if (loadingJoke1 == 1)
|
||||
Console.WriteLine("[sos] Shifting the OS...");
|
||||
if (loadingJoke1 == 2)
|
||||
Console.WriteLine("[sos] Placing things everywhere...");
|
||||
if (loadingJoke1 == 3)
|
||||
Console.WriteLine("[sos] Making an an errors...");
|
||||
if (loadingJoke1 == 4)
|
||||
Console.WriteLine("[sos] Testing to see if this OS is indeed on...");
|
||||
Thread.Sleep(50);
|
||||
Console.WriteLine("[simpl-conf] Reading configuration files (global-3.conf)");
|
||||
Thread.Sleep(20);
|
||||
Console.WriteLine("[termdb] Building command database from filesystem...");
|
||||
TerminalBackend.PopulateTerminalCommands();
|
||||
|
||||
|
@ -178,22 +163,29 @@ namespace ShiftOS.Engine
|
|||
bool guidReceived = false;
|
||||
ServerManager.GUIDReceived += (str) =>
|
||||
{
|
||||
//Connection successful! Stop waiting!
|
||||
guidReceived = true;
|
||||
//Connection successful! Stop waiting!
|
||||
guidReceived = true;
|
||||
Console.WriteLine("[inetd] Connection successful.");
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
ServerManager.Initiate(UserConfig.Get().DigitalSocietyAddress, UserConfig.Get().DigitalSocietyPort);
|
||||
//This haults the client until the connection is successful.
|
||||
while (ServerManager.thisGuid == new Guid())
|
||||
if (ServerManager.ServerOnline)
|
||||
{
|
||||
Thread.Sleep(10);
|
||||
ServerManager.Initiate(UserConfig.Get().DigitalSocietyAddress, UserConfig.Get().DigitalSocietyPort);
|
||||
//This haults the client until the connection is successful.
|
||||
while (ServerManager.thisGuid == new Guid())
|
||||
{
|
||||
Thread.Sleep(10);
|
||||
}
|
||||
Console.WriteLine("[inetd] DHCP GUID recieved, finished setup");
|
||||
FinishBootstrap();
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("[inetd] No suitable network interface card found, skipping network connection.");
|
||||
FinishBootstrap();
|
||||
}
|
||||
Console.WriteLine("[inetd] DHCP GUID recieved, finished setup");
|
||||
FinishBootstrap();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -535,8 +527,10 @@ namespace ShiftOS.Engine
|
|||
{
|
||||
try
|
||||
{
|
||||
Story.Start(CurrentSave.PickupPoint);
|
||||
TerminalBackend.PrintPrompt();
|
||||
if (Story.Context == null)
|
||||
{
|
||||
Story.Start(CurrentSave.PickupPoint);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
@ -643,40 +637,40 @@ namespace ShiftOS.Engine
|
|||
/// </summary>
|
||||
public static void SaveGame()
|
||||
{
|
||||
if (IsSandbox == false)
|
||||
{
|
||||
#if !NOSAVE
|
||||
if (!IsSandbox)
|
||||
if (!Shiftorium.Silent)
|
||||
Console.WriteLine("");
|
||||
if (!Shiftorium.Silent)
|
||||
Console.Write("{SE_SAVING}... ");
|
||||
if (SaveSystem.CurrentSave != null)
|
||||
{
|
||||
if (!Shiftorium.Silent)
|
||||
Console.WriteLine("");
|
||||
if (!Shiftorium.Silent)
|
||||
Console.Write("{SE_SAVING}... ");
|
||||
if (SaveSystem.CurrentSave != null)
|
||||
var serialisedSaveFile = JsonConvert.SerializeObject(CurrentSave, Formatting.Indented);
|
||||
new Thread(() =>
|
||||
{
|
||||
var serialisedSaveFile = JsonConvert.SerializeObject(CurrentSave, Formatting.Indented);
|
||||
new Thread(() =>
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
// 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);
|
||||
}
|
||||
catch { }
|
||||
})
|
||||
{ IsBackground = false }.Start();
|
||||
if (!System.IO.Directory.Exists(Paths.SaveDirectory))
|
||||
{
|
||||
System.IO.Directory.CreateDirectory(Paths.SaveDirectory);
|
||||
|
||||
}
|
||||
catch { }
|
||||
})
|
||||
{ IsBackground = false }.Start();
|
||||
if (!System.IO.Directory.Exists(Paths.SaveDirectory))
|
||||
{
|
||||
System.IO.Directory.CreateDirectory(Paths.SaveDirectory);
|
||||
|
||||
System.IO.File.WriteAllText(Path.Combine(Paths.SaveDirectory, "autosave.save"), serialisedSaveFile);
|
||||
}
|
||||
if (!Shiftorium.Silent)
|
||||
Console.WriteLine(" ...{DONE}.");
|
||||
|
||||
System.IO.File.WriteAllText(Path.Combine(Paths.SaveDirectory, "autosave.save"), serialisedSaveFile);
|
||||
}
|
||||
if (!Shiftorium.Silent)
|
||||
Console.WriteLine(" ...{DONE}.");
|
||||
System.IO.File.WriteAllText(Paths.SaveFile, Utils.ExportMount(0));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in a new issue