aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/KernelWatchdog.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-03-11 09:04:45 -0500
committerMichael <[email protected]>2017-03-11 09:04:45 -0500
commit49812bf46cb153af6bab8e2a095024da84fcc149 (patch)
tree2f357da244276f2576089f03d65a00d8acc65c72 /ShiftOS_TheReturn/KernelWatchdog.cs
parentb9c3a0e30f6a939b1e1e3142cb507dfe7993b683 (diff)
downloadshiftos_thereturn-49812bf46cb153af6bab8e2a095024da84fcc149.tar.gz
shiftos_thereturn-49812bf46cb153af6bab8e2a095024da84fcc149.tar.bz2
shiftos_thereturn-49812bf46cb153af6bab8e2a095024da84fcc149.zip
Lock down various commands while offline.
Diffstat (limited to 'ShiftOS_TheReturn/KernelWatchdog.cs')
-rw-r--r--ShiftOS_TheReturn/KernelWatchdog.cs26
1 files changed, 26 insertions, 0 deletions
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> 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;
+ }
}
}