aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/KernelWatchdog.cs
diff options
context:
space:
mode:
Diffstat (limited to 'ShiftOS_TheReturn/KernelWatchdog.cs')
-rw-r--r--ShiftOS_TheReturn/KernelWatchdog.cs38
1 files changed, 37 insertions, 1 deletions
diff --git a/ShiftOS_TheReturn/KernelWatchdog.cs b/ShiftOS_TheReturn/KernelWatchdog.cs
index 1b59b25..e69c9ba 100644
--- a/ShiftOS_TheReturn/KernelWatchdog.cs
+++ b/ShiftOS_TheReturn/KernelWatchdog.cs
@@ -25,8 +25,44 @@ namespace ShiftOS.Engine
}
}
+ private static bool _mudConnected = true;
+
public static bool InKernelMode { get; private set; }
- public static bool MudConnected { get; set; }
+ public static bool MudConnected
+ {
+ get
+ {
+ return _mudConnected;
+ }
+ set
+ {
+ if(value == false)
+ {
+ foreach(var win in AppearanceManager.OpenForms)
+ {
+ foreach(var attr in win.ParentWindow.GetType().GetCustomAttributes(true))
+ {
+ if(attr is MultiplayerOnlyAttribute)
+ {
+ ConsoleEx.Bold = true;
+ ConsoleEx.Underline = false;
+ ConsoleEx.Italic = true;
+ ConsoleEx.ForegroundColor = ConsoleColor.Red;
+ Console.Write("Error:");
+ ConsoleEx.Bold = false;
+ ConsoleEx.ForegroundColor = ConsoleColor.DarkYellow;
+ Console.WriteLine("Cannot disconnect from multi-user domain because an app that depends on it is open.");
+ TerminalBackend.PrintPrompt();
+ return;
+ }
+ }
+ }
+ }
+
+ _mudConnected = value;
+ Desktop.PopulateAppLauncher();
+ }
+ }
public static bool IsSafe(Type type)
{