aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-30 13:18:08 -0400
committerMichael <[email protected]>2017-05-30 13:18:14 -0400
commit0ca2fffe7a214fb5cc4c6482ca6fb8d1e4d2c4ea (patch)
tree1d6a8f50d59eee36cbffa44f8f8d3a70ca646dd8
parentc6e3d0e905d9c87483f4b8887be6c4d68dcb6f9f (diff)
downloadshiftos_thereturn-0ca2fffe7a214fb5cc4c6482ca6fb8d1e4d2c4ea.tar.gz
shiftos_thereturn-0ca2fffe7a214fb5cc4c6482ca6fb8d1e4d2c4ea.tar.bz2
shiftos_thereturn-0ca2fffe7a214fb5cc4c6482ca6fb8d1e4d2c4ea.zip
storydev.list command
-rw-r--r--ShiftOS.WinForms/HackerCommands.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/ShiftOS.WinForms/HackerCommands.cs b/ShiftOS.WinForms/HackerCommands.cs
index f467eb2..316b7fc 100644
--- a/ShiftOS.WinForms/HackerCommands.cs
+++ b/ShiftOS.WinForms/HackerCommands.cs
@@ -2,12 +2,14 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
+using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json;
using ShiftOS.Engine;
using ShiftOS.Objects;
+using ShiftOS.Objects.ShiftFS;
using ShiftOS.WinForms.Applications;
using static ShiftOS.Objects.ShiftFS.Utils;
@@ -674,6 +676,34 @@ namespace ShiftOS.WinForms
return true;
}
+ [Command("list", description ="Lists all story IDs.")]
+ public static bool ListIds()
+ {
+ foreach(var exec in System.IO.Directory.GetFiles(Environment.CurrentDirectory))
+ {
+ if(exec.ToLower().EndsWith(".exe") || exec.ToLower().EndsWith(".dll"))
+ {
+ try
+ {
+ var asm = Assembly.LoadFile(exec);
+ {
+ foreach(var type in asm.GetTypes())
+ {
+ foreach(var method in type.GetMethods(BindingFlags.Public | BindingFlags.Static))
+ {
+ var attr = method.GetCustomAttributes(false).FirstOrDefault(x => x is StoryAttribute);
+ if (attr != null)
+ Console.WriteLine(" - " + (attr as StoryAttribute).StoryID);
+ }
+ }
+ }
+ }
+ catch { }
+ }
+ }
+ return true;
+ }
+
[Command("unexperience", description = "Marks a story plot as not-experienced yet.", usage ="id:string")]
[RemoteLock]
[RequiresArgument("id")]