aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/SaveSystem.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS_TheReturn/SaveSystem.cs')
-rw-r--r--ShiftOS_TheReturn/SaveSystem.cs64
1 files changed, 32 insertions, 32 deletions
diff --git a/ShiftOS_TheReturn/SaveSystem.cs b/ShiftOS_TheReturn/SaveSystem.cs
index 489b718..55f5cd5 100644
--- a/ShiftOS_TheReturn/SaveSystem.cs
+++ b/ShiftOS_TheReturn/SaveSystem.cs
@@ -153,50 +153,50 @@ namespace ShiftOS.Engine
}
}
- if (defaultConf.ConnectToMud == true)
+
+
+ bool guidReceived = false;
+ ServerManager.GUIDReceived += (str) =>
{
- bool guidReceived = false;
- ServerManager.GUIDReceived += (str) =>
- {
//Connection successful! Stop waiting!
guidReceived = true;
- Console.WriteLine("[inetd] Connection successful.");
- };
+ 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())
- {
- Thread.Sleep(10);
- }
- Console.WriteLine("[inetd] DHCP GUID recieved, finished setup");
- FinishBootstrap();
- }
- catch (Exception ex)
+ try
+ {
+
+ ServerManager.Initiate(UserConfig.Get().DigitalSocietyAddress, UserConfig.Get().DigitalSocietyPort);
+ //This haults the client until the connection is successful.
+ while (ServerManager.thisGuid == new Guid())
{
- //No errors, this never gets called.
- Console.WriteLine("[inetd] SEVERE: " + ex.Message);
- Thread.Sleep(3000);
- ServerManager.StartLANServer();
- while (ServerManager.thisGuid == new Guid())
- {
- Thread.Sleep(10);
- }
- Console.WriteLine("[inetd] DHCP GUID recieved, finished setup");
- FinishBootstrap();
+ Thread.Sleep(10);
}
+ Console.WriteLine("[inetd] DHCP GUID recieved, finished setup");
+ FinishBootstrap();
}
- else
+ catch (Exception ex)
{
- ServerManager.StartLANServer();
+ //No errors, this never gets called.
+ Console.WriteLine("[inetd] SEVERE: " + ex.Message);
+ Thread.Sleep(3000);
+ Console.WriteLine("[sys] SEVERE: Cannot connect to server. Shutting down in 5...");
+ Thread.Sleep(1000);
+ Console.WriteLine("[sys] 4...");
+ Thread.Sleep(1000);
+ Console.WriteLine("[sys] 3...");
+ Thread.Sleep(1000);
+ Console.WriteLine("[sys] 2...");
+ Thread.Sleep(1000);
+ Console.WriteLine("[sys] 1...");
+ Thread.Sleep(1000);
+ Console.WriteLine("[sys] Bye bye.");
+ System.Diagnostics.Process.GetCurrentProcess().Kill();
}
//Nothing happens past this point - but the client IS connected! It shouldn't be stuck in that while loop above.
-
+
}));
thread.IsBackground = true;
thread.Start();