From ccd677e7a8b47c11a31bbd5ebf2f6cc8be9a8384 Mon Sep 17 00:00:00 2001 From: Hanny Date: Mon, 26 Jun 2023 21:57:25 +0200 Subject: [PATCH] 2nd VRChat OSC output works as intended, changed version to v0.7.439 --- .../Classes/DataAndSecurity/DataController.cs | 2 +- vrcosc-magicchatbox/Classes/OSCController.cs | 18 ++++++------------ vrcosc-magicchatbox/ViewModels/ViewModel.cs | 2 +- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/vrcosc-magicchatbox/Classes/DataAndSecurity/DataController.cs b/vrcosc-magicchatbox/Classes/DataAndSecurity/DataController.cs index 02bddfe1..0d7d9e40 100644 --- a/vrcosc-magicchatbox/Classes/DataAndSecurity/DataController.cs +++ b/vrcosc-magicchatbox/Classes/DataAndSecurity/DataController.cs @@ -265,7 +265,7 @@ public static void ManageSettingsXML(bool saveSettings = false) {"OSCIP", (typeof(string), "OSC")}, {"OSCPortOut", (typeof(int), "OSC")}, - {"SecOSC", (typeof(string), "OSC")}, + {"SecOSC", (typeof(bool), "OSC")}, {"SecOSCPort", (typeof(int), "OSC")}, {"BlankEgg", (typeof(bool), "DEV")}, diff --git a/vrcosc-magicchatbox/Classes/OSCController.cs b/vrcosc-magicchatbox/Classes/OSCController.cs index b7f1896f..85998a53 100644 --- a/vrcosc-magicchatbox/Classes/OSCController.cs +++ b/vrcosc-magicchatbox/Classes/OSCController.cs @@ -7,14 +7,8 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows; using vrcosc_magicchatbox.Classes.DataAndSecurity; using vrcosc_magicchatbox.ViewModels; -using System.Windows.Media; -using System.Diagnostics; -using System.Windows.Threading; namespace vrcosc_magicchatbox.Classes { @@ -87,7 +81,7 @@ await Task.Run(() => oscSender.Send(new OscMessage("/chatbox/input", ViewModel.Instance.OSCtoSent, true, FX)); if (ViewModel.Instance.SecOSC) { - oscSender.Send(new OscMessage("/chatbox/input", ViewModel.Instance.OSCtoSent, true, FX)); + SecOscSender.Send(new OscMessage("/chatbox/input", ViewModel.Instance.OSCtoSent, true, FX)); } } @@ -146,14 +140,14 @@ await Task.Run(() => oscSender.Send(new OscMessage("/input/Voice", 1)); if (ViewModel.Instance.SecOSC) { - oscSender.Send(new OscMessage("/input/Voice", 1)); + SecOscSender.Send(new OscMessage("/input/Voice", 1)); } ViewModel.Instance.TTSBtnShadow = true; Thread.Sleep(100); oscSender.Send(new OscMessage("/input/Voice", 0)); if (ViewModel.Instance.SecOSC) { - oscSender.Send(new OscMessage("/input/Voice", 1)); + SecOscSender.Send(new OscMessage("/input/Voice", 1)); } ViewModel.Instance.TTSBtnShadow = false; }); @@ -189,8 +183,8 @@ public static async Task TypingIndicatorAsync(bool Typing) // Check if we need to close the SECcurrent sender and create a new one with the updated IP and port if (SecOscSender != null && (ViewModel.Instance.OSCIP != SecOscSender.Address || ViewModel.Instance.SecOSCPort != SecOscSender.Port)) { - oscSender.Close(); - oscSender = null; + SecOscSender.Close(); + SecOscSender = null; } // Create a new sender if there is none @@ -211,7 +205,7 @@ await Task.Run(() => oscSender.Send(new OscMessage("/chatbox/typing", Typing)); if (ViewModel.Instance.SecOSC) { - oscSender.Send(new OscMessage("/chatbox/typing", Typing)); + SecOscSender.Send(new OscMessage("/chatbox/typing", Typing)); } }); diff --git a/vrcosc-magicchatbox/ViewModels/ViewModel.cs b/vrcosc-magicchatbox/ViewModels/ViewModel.cs index d401a6dc..623e48e0 100644 --- a/vrcosc-magicchatbox/ViewModels/ViewModel.cs +++ b/vrcosc-magicchatbox/ViewModels/ViewModel.cs @@ -511,7 +511,7 @@ private void UpdateToggleVoiceText() private bool _Time24H = false; private string _OSCtoSent = ""; private string _ApiStream = "b2t8DhYcLcu7Nu0suPcvc8lO27wztrjMPbb + 8hQ1WPba2dq / iRyYpBEDZ0NuMNKR5GRrF2XdfANLud0zihG / UD + ewVl1p3VLNk1mrNdrdg88rguzi6RJ7T1AA7hyBY + F"; - private Version _AppVersion = new("0.7.412"); + private Version _AppVersion = new("0.7.439"); private Version _GitHubVersion; private string _VersionTxt = "Check for updates"; private string _VersionTxtColor = "#FF8F80B9";