diff --git a/FakeDeckUI/FakeDeck/ButtonType/HelldiversTwoMacro.cs b/FakeDeckUI/FakeDeck/ButtonType/HelldiversTwoMacro.cs
index 19e41dc..e162191 100644
--- a/FakeDeckUI/FakeDeck/ButtonType/HelldiversTwoMacro.cs
+++ b/FakeDeckUI/FakeDeck/ButtonType/HelldiversTwoMacro.cs
@@ -1,6 +1,7 @@
using FakeeDeck.Class;
using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -83,7 +84,7 @@ namespace FakeeDeck.ButtonType
foreach (var key in stratogems[stratogem])
{
KeyboardMacro.SendKey(key);
- Console.WriteLine(key);
+ Debug.WriteLine(key);
}
return true;
}
diff --git a/FakeDeckUI/FakeDeck/Class/AutoUpdateHelper.cs b/FakeDeckUI/FakeDeck/Class/AutoUpdateHelper.cs
index 208957f..7bf6ca0 100644
--- a/FakeDeckUI/FakeDeck/Class/AutoUpdateHelper.cs
+++ b/FakeDeckUI/FakeDeck/Class/AutoUpdateHelper.cs
@@ -2,20 +2,26 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
+using System.IO;
using System.Linq;
+using System.Net;
using System.Net.Http.Json;
+using System.Reflection;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
+using System.Windows;
namespace FakeeDeck.Class
{
- internal class AutoUpdateHelper
+ public class AutoUpdateHelper
{
public AutoUpdateHelper() {
AutoUpdater.ParseUpdateInfoEvent += AutoUpdaterOnParseUpdateInfoEvent;
AutoUpdater.Synchronous = true;
AutoUpdater.ShowRemindLaterButton = false;
+ AutoUpdater.ReportErrors = Debugger.IsAttached;
+ AutoUpdater.HttpUserAgent = ("FakeDeck-v" + Assembly.GetExecutingAssembly().GetName().Version);
AutoUpdater.Start("https://api.github.com/repos/ravibpatel/AutoUpdater.NET/releases/latest");
}
private void AutoUpdaterOnParseUpdateInfoEvent(ParseUpdateInfoEventArgs args)
@@ -23,11 +29,10 @@ namespace FakeeDeck.Class
JsonElement json = JsonDocument.Parse(args.RemoteData).RootElement;
args.UpdateInfo = new UpdateInfoEventArgs
{
- CurrentVersion = json.GetProperty("tag_name").ToString().TrimStart('v'),
+ CurrentVersion = json.GetProperty("tag_name").ToString().TrimStart('v')+ ".0",
DownloadURL = json.GetProperty("zipball_url").ToString(),
};
-
- Debug.WriteLine(json.ToString());
+ Debug.WriteLine("calling Updater");
}
}
}
diff --git a/FakeDeckUI/FakeDeck/Class/FakeDeckMain.cs b/FakeDeckUI/FakeDeck/Class/FakeDeckMain.cs
index 98ff66a..dd14957 100644
--- a/FakeDeckUI/FakeDeck/Class/FakeDeckMain.cs
+++ b/FakeDeckUI/FakeDeck/Class/FakeDeckMain.cs
@@ -1,21 +1,39 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using YamlDotNet.Serialization.NamingConventions;
-using YamlDotNet.Serialization;
-using System.Diagnostics;
-using System.IO;
-using System.Text.Json;
+using System.Diagnostics;
+using System.Net;
using System.Reflection;
-using FakeeDeck.ButtonType;
-using YamlDotNet.Serialization;
+using System.Reflection.PortableExecutable;
+using System.Text;
+using System.Text.Json;
namespace FakeeDeck.Class
{
internal class FakeDeckMain
{
+ public static string pageHeader =
+ "" +
+ "" +
+ "
" +
+ " HttpListener Example" +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ " " +
+ "
" +
+ "
Page Views: {0}
" +
+ "
";
+ public static string pageFooter =
+ "
" +
+ " " +
+ "
" +
+ "
" +
+ " " +
+ " " +
+ "";
+ public string pageData = "";
public FakeDeckMain(YamlHelper yaml)
{
HttpServer server = new HttpServer(yaml.getData().GetProperty("server").GetProperty("port").ToString());
@@ -25,10 +43,13 @@ namespace FakeeDeck.Class
Debug.WriteLine("PAGE: " + item.GetProperty("page"));
foreach (JsonElement button in item.GetProperty("buttons").EnumerateArray())
{
- server.pageData += AbstractionHelper.getButtonVisual(button);
+ pageData += AbstractionHelper.getButtonVisual(button);
}
}
+ server.addRoute(servViewResponseAsync, "GET", "/");
+ server.addRoute(servButtonResponseAsync, "POST", "/button/");
+
/*foreach (var stratogem in HelldiversTwoMacro.stratogems)
{
server.pageData += HelldiversTwoMacro.getButton(stratogem.Key);
@@ -41,5 +62,72 @@ namespace FakeeDeck.Class
server.serv();
}
+
+ private static void callButtonAction(string module, Dictionary postParams)
+ {
+ string cleanClass = "FakeeDeck.ButtonType." + module.Trim('/');
+
+ Type? buttonClass = Type.GetType(cleanClass, true);
+
+ if (buttonClass is null)
+ return;
+
+ MethodInfo? method = buttonClass.GetMethod("invokeAction");
+
+ if (method is null)
+ return;
+
+ ParameterInfo[] pars = method.GetParameters();
+ List