From c18e14c98e0553aefd6f6828512a0f2f20510a78 Mon Sep 17 00:00:00 2001 From: TauAkiou Date: Wed, 6 Apr 2022 08:41:55 -0400 Subject: [PATCH] fixed DBus backend. --- AUCapture-GTK/IPC/DBus/IPCAdapterDBus.cs | 5 ++--- AUCapture-GTK/MainGTKWindow.cs | 9 ++++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/AUCapture-GTK/IPC/DBus/IPCAdapterDBus.cs b/AUCapture-GTK/IPC/DBus/IPCAdapterDBus.cs index 41ccf21e..07adf09b 100644 --- a/AUCapture-GTK/IPC/DBus/IPCAdapterDBus.cs +++ b/AUCapture-GTK/IPC/DBus/IPCAdapterDBus.cs @@ -60,9 +60,8 @@ public override URIStartResult HandleURIStart(string[] args) foreach (ProcessModule mod in capproc.Modules) { - // If we find amonguscapturedll in the modules, we can be certain - // that the located pid is, in fact, an AmongUsCapture process. - if (mod.ModuleName == "AmongUsCapture.dll") + // Look for the AUCapture-GTK Module to insure that the capture is in fact a caputre process. + if (mod.ModuleName == "AUCapture-GTK") { iscapture = true; break; diff --git a/AUCapture-GTK/MainGTKWindow.cs b/AUCapture-GTK/MainGTKWindow.cs index c9cae2b9..90272b92 100644 --- a/AUCapture-GTK/MainGTKWindow.cs +++ b/AUCapture-GTK/MainGTKWindow.cs @@ -84,6 +84,7 @@ public MainGTKWindow(ClientSocket sock) : base("Among Us Capture - GTK") InitializeWindow(); GameMemReader.getInstance().ProcessHook += _eventGameIsHooked; GameMemReader.getInstance().ProcessUnHook += _eventGameIsUnhooked; + IPCAdapter.getInstance().OnToken += _eventOnTokenHandler; // Load URL @@ -204,7 +205,7 @@ private void _primaryWindowInstallLinkWindow_Dialog(object o, EventArgs e) { "\n\nIf you decline, Discord connection links will not be functional." + "\n\nYou can install or manage One-Click support by using the \"One-Click Connection Management\" link in the File menu."; - InstallLinkDialogBox.Text = info; + InstallLinkDialogBox.Text = info; InstallLinkDialogBox.Title = "Enable One-Click Connection?"; InstallLinkDialogBox.AddButton("Cancel", ResponseType.Reject); InstallLinkDialogBox.AddButton("Install", ResponseType.Accept); @@ -498,6 +499,12 @@ private void _consoleTextView_BufferChanged(object sender, EventArgs e) } } + + public void _eventOnTokenHandler(object sender, StartToken token) + { + Logger.Info("Attempting to connect to host: {host} with connect code: {connectCode}", token.Host, token.ConnectCode); + clientSocket.Connect(token.Host, token.ConnectCode); + } public void WriteConsoleLineFormatted(string moduleName, Color moduleColor, string message) {