Skip to content

Commit

Permalink
Remove ping stats from server notifier
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaboxer committed Mar 13, 2023
1 parent f8dd388 commit add07a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
19 changes: 3 additions & 16 deletions Bloxstrap/Integrations/ServerNotifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,12 @@ public async void Notify()
if (String.IsNullOrEmpty(locationCountry))
message = "Location: N/A";
else if (locationCity == locationRegion)
message = $"Location: {locationRegion}, {locationCountry}\n";
message = $"Location: {locationRegion}, {locationCountry}";
else
message = $"Location: {locationCity}, {locationRegion}, {locationCountry}\n";
message = $"Location: {locationCity}, {locationRegion}, {locationCountry}";

// UDMUX protected servers don't respond to ICMP packets and so the ping fails
// we could probably get around this by doing a UDP latency test but ehhhhhhhh
if (_activityWatcher.ActivityMachineUDMUX)
{
message += "Latency: N/A (Server is UDMUX protected)";
}
else
{
PingReply ping = await new Ping().SendPingAsync(machineAddress);

if (ping.Status == IPStatus.Success)
message += $"Latency: ~{ping.RoundtripTime}ms";
else
message += $"Latency: N/A (Code {ping.Status})";
}
message += "\nServer is UDMUX protected";

App.Logger.WriteLine($"[ServerNotifier::Notify] {message.ReplaceLineEndings("\\n")}");

Expand Down
2 changes: 1 addition & 1 deletion Bloxstrap/Views/Pages/IntegrationsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<ui:CardControl.Header>
<StackPanel>
<TextBlock FontSize="14" Text="Show server details of current game" />
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Be notified of useful server details (e.g. location and ping) whenever you join a game." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
<TextBlock Margin="0,2,0,0" FontSize="12" Text="Be notified of useful server details whenever you join a game." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
</StackPanel>
</ui:CardControl.Header>
<ui:ToggleSwitch IsChecked="{Binding ShowServerDetailsEnabled, Mode=TwoWay}" />
Expand Down

0 comments on commit add07a1

Please sign in to comment.