From 744a9520c131306c29e1a1f78b398de046b93cc6 Mon Sep 17 00:00:00 2001 From: firealarmss Date: Wed, 5 Mar 2025 10:17:56 -0600 Subject: [PATCH] Add support for network level authentication --- WhackerLinkConsoleV2/MainWindow.xaml.cs | 23 ++++++++------------- WhackerLinkConsoleV2/codeplugs/codeplug.yml | 1 + WhackerLinkLib | 2 +- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/WhackerLinkConsoleV2/MainWindow.xaml.cs b/WhackerLinkConsoleV2/MainWindow.xaml.cs index dbe62a1..06c266c 100644 --- a/WhackerLinkConsoleV2/MainWindow.xaml.cs +++ b/WhackerLinkConsoleV2/MainWindow.xaml.cs @@ -216,26 +216,21 @@ namespace WhackerLinkConsoleV2 systemStatusBox.Background = new SolidColorBrush(Colors.Red); systemStatusBox.ConnectionState = "Disconnected"; }); + }; - Thread.Sleep(1000); - - Task.Factory.StartNew(() => - { - handler.Connect(system.Address, system.Port); - - U_REG_REQ release = new U_REG_REQ - { - SrcId = system.Rid, - Site = system.Site - }; + handler.OnOpen += () => + { + Console.WriteLine("Peer connected"); + }; - handler.SendMessage(release.GetData()); - }); + handler.OnReconnecting += () => + { + Console.WriteLine("Peer reconnecting"); }; Task.Factory.StartNew(() => { - handler.Connect(system.Address, system.Port); + handler.Connect(system.Address, system.Port, system.AuthKey); handler.OnGroupAffiliationResponse += (response) => { /* TODO */ }; diff --git a/WhackerLinkConsoleV2/codeplugs/codeplug.yml b/WhackerLinkConsoleV2/codeplugs/codeplug.yml index 0d6e285..923a6ee 100644 --- a/WhackerLinkConsoleV2/codeplugs/codeplug.yml +++ b/WhackerLinkConsoleV2/codeplugs/codeplug.yml @@ -10,6 +10,7 @@ systems: - name: "System 1" address: "localhost" port: 3000 + authKey: "" rid: "12345" site: name: "Central Site" diff --git a/WhackerLinkLib b/WhackerLinkLib index 8982a92..0913ce1 160000 --- a/WhackerLinkLib +++ b/WhackerLinkLib @@ -1 +1 @@ -Subproject commit 8982a924e1b64a11782b2b5d44baa01fd1ab95d0 +Subproject commit 0913ce1acc012436e7038f5b6b0b22e6c04cb7e0