Skip to content

Commit

Permalink
Merge pull request #94 from BoiHanny/Pre-Master
Browse files Browse the repository at this point in the history
Exclude IPv6 statistics (network stats), and adjusted UI padding
  • Loading branch information
BoiHanny authored Nov 30, 2024
2 parents 89f4a94 + a477d64 commit e445134
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
11 changes: 5 additions & 6 deletions vrcosc-magicchatbox/Classes/Modules/NetworkStatisticsModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ private async Task InitializeNetworkStatsAsync()

/// <summary>
/// Asynchronously determines the active network interface.
/// Includes both IPv4 and IPv6 statistics.
/// Includes only IPv4 statistics.
/// </summary>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>The selected active NetworkInterface or null if none found.</returns>
Expand Down Expand Up @@ -240,18 +240,18 @@ private int GetInterfacePriority(NetworkInterface ni)
}

/// <summary>
/// Retrieves total bytes sent and received, including both IPv4 and IPv6.
/// Retrieves total bytes sent and received, including only IPv4 statistics.
/// </summary>
/// <param name="ni">NetworkInterface.</param>
/// <returns>TotalBytes struct containing BytesReceived and BytesSent.</returns>
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
};
}

Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions vrcosc-magicchatbox/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7622,6 +7622,7 @@
Height="auto"
VerticalAlignment="Bottom">
<TextBlock
Padding="0,0,0,30"
HorizontalAlignment="Center"
VerticalAlignment="Stretch"
FontFamily="Albert Sans Thin"
Expand Down

0 comments on commit e445134

Please sign in to comment.