aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS_TheReturn/AppLauncherDaemon.cs
diff options
context:
space:
mode:
authorMichael VanOverbeek <[email protected]>2017-06-11 11:57:31 +0000
committerGitHub <[email protected]>2017-06-11 11:57:31 +0000
commit997a81457ebb6d6523c36ca552cee143e0d92244 (patch)
treeda98985ced112b6d238811f3ca770014d67e34fc /ShiftOS_TheReturn/AppLauncherDaemon.cs
parent0d75f701778a0900a58343c4c80c124279bc231f (diff)
parent107a98686a105468b5f200ebcbd27343c1210ce4 (diff)
downloadshiftos_thereturn-997a81457ebb6d6523c36ca552cee143e0d92244.tar.gz
shiftos_thereturn-997a81457ebb6d6523c36ca552cee143e0d92244.tar.bz2
shiftos_thereturn-997a81457ebb6d6523c36ca552cee143e0d92244.zip
Merge pull request #129 from RogueAI42/master
ReflectMan Saves The Day..............
Diffstat (limited to 'ShiftOS_TheReturn/AppLauncherDaemon.cs')
-rw-r--r--ShiftOS_TheReturn/AppLauncherDaemon.cs53
1 files changed, 7 insertions, 46 deletions
diff --git a/ShiftOS_TheReturn/AppLauncherDaemon.cs b/ShiftOS_TheReturn/AppLauncherDaemon.cs
index 716a6a3..c259556 100644
--- a/ShiftOS_TheReturn/AppLauncherDaemon.cs
+++ b/ShiftOS_TheReturn/AppLauncherDaemon.cs
@@ -63,55 +63,16 @@ namespace ShiftOS.Engine
{
List<LauncherItem> win = new List<LauncherItem>();
- foreach (var asmExec in System.IO.Directory.GetFiles(Environment.CurrentDirectory))
+ foreach (var type in Array.FindAll(ReflectMan.Types, t => t.GetInterfaces().Contains(typeof(IShiftOSWindow)) && Shiftorium.UpgradeAttributesUnlocked(t)))
{
- if (asmExec.EndsWith(".dll") | asmExec.EndsWith(".exe"))
- {
- try
- {
- var asm = Assembly.LoadFrom(asmExec);
-
- if (asm.GetReferencedAssemblies().Contains("ShiftOS.Engine") || asm.FullName.Contains("ShiftOS.Engine"))
+ foreach (var attr in type.GetCustomAttributes(false))
+ if (!(attr is MultiplayerOnlyAttribute && !KernelWatchdog.MudConnected))
+ if (attr is LauncherAttribute)
{
- foreach (var type in asm.GetTypes())
- {
- if (type.GetInterfaces().Contains(typeof(IShiftOSWindow)))
- {
- bool isAllowed = true;
- foreach (var attr in type.GetCustomAttributes(false))
- {
- if(attr is MultiplayerOnlyAttribute)
- {
- if(KernelWatchdog.MudConnected == false)
- {
- isAllowed = false;
-
- }
- }
- if (isAllowed == true)
- {
- if (attr is LauncherAttribute)
- {
- if (Shiftorium.UpgradeAttributesUnlocked(type))
- {
- var launch = attr as LauncherAttribute;
- if (launch.UpgradeInstalled)
- {
- win.Add(new LauncherItem { DisplayData = launch, LaunchType = type });
- }
- }
- }
- }
- }
- }
- }
+ var launch = attr as LauncherAttribute;
+ if (launch.UpgradeInstalled)
+ win.Add(new LauncherItem { DisplayData = launch, LaunchType = type });
}
- }
- catch
- {
-
- }
- }
}
foreach(var file in Utils.GetFiles(Paths.GetPath("applauncher")))