From 5e0de060aaea35b249bd01d36cbe0b0236cbaa0e Mon Sep 17 00:00:00 2001 From: BoiHanny <114599052+BoiHanny@users.noreply.github.com> Date: Sat, 30 Nov 2024 22:37:18 +0100 Subject: [PATCH 1/2] Refactor to handle only IPv4 statistics Updated NetworkStatisticsModule.cs to focus solely on IPv4 statistics. Modified comments and functionality in `GetActiveNetworkInterfaceAsync` and `GetTotalBytes` methods to exclude IPv6 statistics. Removed lines adding IPv6 stats in `GetTotalBytes` and unnecessary comments. --- .../Classes/Modules/NetworkStatisticsModule.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/vrcosc-magicchatbox/Classes/Modules/NetworkStatisticsModule.cs b/vrcosc-magicchatbox/Classes/Modules/NetworkStatisticsModule.cs index 0749f2d..2e61bf8 100644 --- a/vrcosc-magicchatbox/Classes/Modules/NetworkStatisticsModule.cs +++ b/vrcosc-magicchatbox/Classes/Modules/NetworkStatisticsModule.cs @@ -170,7 +170,7 @@ private async Task InitializeNetworkStatsAsync() /// /// Asynchronously determines the active network interface. - /// Includes both IPv4 and IPv6 statistics. + /// Includes only IPv4 statistics. /// /// Cancellation token. /// The selected active NetworkInterface or null if none found. @@ -240,18 +240,18 @@ private int GetInterfacePriority(NetworkInterface ni) } /// - /// Retrieves total bytes sent and received, including both IPv4 and IPv6. + /// Retrieves total bytes sent and received, including only IPv4 statistics. /// /// NetworkInterface. /// TotalBytes struct containing BytesReceived and BytesSent. private TotalBytes GetTotalBytes(NetworkInterface ni) { var ipv4Stats = ni.GetIPv4Statistics(); - var ipv6Stats = ni.GetIPStatistics(); + // Removed IPv6 statistics to avoid duplication return new TotalBytes { - BytesReceived = ipv4Stats.BytesReceived + ipv6Stats.BytesReceived, - BytesSent = ipv4Stats.BytesSent + ipv6Stats.BytesSent + BytesReceived = ipv4Stats.BytesReceived, + BytesSent = ipv4Stats.BytesSent }; } @@ -297,7 +297,6 @@ private void OnTimedEvent(object state) { if (_activeNetworkInterface == null) { - // Attempt to re-initialize if the active interface is null InitializeNetworkStatsAsync().ConfigureAwait(false); if (_activeNetworkInterface == null) return; From a477d6460ed2dae629b8048cdb19f473f134ab4f Mon Sep 17 00:00:00 2001 From: BoiHanny <114599052+BoiHanny@users.noreply.github.com> Date: Sat, 30 Nov 2024 22:43:58 +0100 Subject: [PATCH 2/2] Add bottom padding to TextBlock in MainWindow.xaml Added Padding attribute with value 0,0,0,30 to the TextBlock element within the Grid in MainWindow.xaml. This change creates additional space below the TextBlock, affecting its layout and positioning. --- vrcosc-magicchatbox/MainWindow.xaml | 1 + 1 file changed, 1 insertion(+) diff --git a/vrcosc-magicchatbox/MainWindow.xaml b/vrcosc-magicchatbox/MainWindow.xaml index facca2b..bd79c51 100644 --- a/vrcosc-magicchatbox/MainWindow.xaml +++ b/vrcosc-magicchatbox/MainWindow.xaml @@ -7622,6 +7622,7 @@ Height="auto" VerticalAlignment="Bottom">