diff options
| author | Michael <[email protected]> | 2017-03-10 12:29:28 -0500 |
|---|---|---|
| committer | Michael <[email protected]> | 2017-03-10 12:29:28 -0500 |
| commit | a9754b7df28795b6bb2c5cfe04c1b38b19fb0d05 (patch) | |
| tree | 6ad4355d5c413df83b4e55710bc9850448279697 /ShiftOS_TheReturn/KernelWatchdog.cs | |
| parent | a9b08eb21676a6c59b0c8bb6046b40bd42e078d5 (diff) | |
| download | shiftos_thereturn-a9754b7df28795b6bb2c5cfe04c1b38b19fb0d05.tar.gz shiftos_thereturn-a9754b7df28795b6bb2c5cfe04c1b38b19fb0d05.tar.bz2 shiftos_thereturn-a9754b7df28795b6bb2c5cfe04c1b38b19fb0d05.zip | |
Lock certain apps away when system offline.
Diffstat (limited to 'ShiftOS_TheReturn/KernelWatchdog.cs')
| -rw-r--r-- | ShiftOS_TheReturn/KernelWatchdog.cs | 38 |
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) { |
