From 49812bf46cb153af6bab8e2a095024da84fcc149 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 11 Mar 2017 09:04:45 -0500 Subject: Lock down various commands while offline. --- ShiftOS_TheReturn/KernelWatchdog.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'ShiftOS_TheReturn/KernelWatchdog.cs') diff --git a/ShiftOS_TheReturn/KernelWatchdog.cs b/ShiftOS_TheReturn/KernelWatchdog.cs index e69c9ba..cc03f5a 100644 --- a/ShiftOS_TheReturn/KernelWatchdog.cs +++ b/ShiftOS_TheReturn/KernelWatchdog.cs @@ -102,5 +102,31 @@ namespace ShiftOS.Engine InKernelMode = false; Console.WriteLine(" Kernel mode disabled."); } + + internal static bool CanRunOffline(Type method) + { + if (MudConnected) + return true; + + foreach (var attr in method.GetCustomAttributes(false)) + { + if (attr is MultiplayerOnlyAttribute) + return false; + } + return true; + } + + internal static bool CanRunOffline(MethodInfo method) + { + if (MudConnected) + return true; + + foreach(var attr in method.GetCustomAttributes(false)) + { + if (attr is MultiplayerOnlyAttribute) + return false; + } + return true; + } } } -- cgit v1.2.3