From 8ca203f34b2db8aa890be3938021c9471cafe0da Mon Sep 17 00:00:00 2001 From: RMBGAME Date: Sat, 31 Aug 2024 19:09:17 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E5=A4=9A=E4=B8=AA=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Styling/Controls/AppItem.axaml | 4 +- .../Net/DnsDohAnalysisService.cs | 6 ++ .../NetworkTestService.cs | 8 ++- .../UI/ViewModels/AcceleratorPageViewModel.cs | 2 +- .../AcceleratorPageViewModel.props.cs | 2 +- .../UI/Views/Controls/NetworkCheck.axaml | 63 +++++++++++++------ .../UI/Views/Pages/ScriptPage.axaml | 5 ++ .../UI/Views/Controls/AuthenticatorItem.axaml | 5 ++ .../UI/Assets/Platforms.json | 4 +- .../UI/ViewModels/GameAccountPageViewModel.cs | 8 ++- .../UI/Views/Pages/GameAccountPage.axaml | 2 +- 11 files changed, 82 insertions(+), 27 deletions(-) diff --git a/src/BD.WTTS.Client.Avalonia/UI/Styling/Controls/AppItem.axaml b/src/BD.WTTS.Client.Avalonia/UI/Styling/Controls/AppItem.axaml index 966f4e3b40b..a675ea842d5 100644 --- a/src/BD.WTTS.Client.Avalonia/UI/Styling/Controls/AppItem.axaml +++ b/src/BD.WTTS.Client.Avalonia/UI/Styling/Controls/AppItem.axaml @@ -65,7 +65,7 @@ @@ -181,7 +181,7 @@ Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" - Margin="0,5" + Margin="0,5,12,5" VerticalAlignment="Top" Classes="CaptionTextBlockStyle" FontSize="12" diff --git a/src/BD.WTTS.Client.Plugins.Accelerator.ReverseProxy/Services.Implementation/Net/DnsDohAnalysisService.cs b/src/BD.WTTS.Client.Plugins.Accelerator.ReverseProxy/Services.Implementation/Net/DnsDohAnalysisService.cs index 0905311175f..262b7239e74 100644 --- a/src/BD.WTTS.Client.Plugins.Accelerator.ReverseProxy/Services.Implementation/Net/DnsDohAnalysisService.cs +++ b/src/BD.WTTS.Client.Plugins.Accelerator.ReverseProxy/Services.Implementation/Net/DnsDohAnalysisService.cs @@ -63,6 +63,12 @@ DnsHttpClient GetDnsHttpClient(Uri dohAddresUri) var client = new HttpClient(handler); client.BaseAddress = dohAddresUri; var dnsClient = new DnsHttpClient(client); + //暂未考虑释放问题 注意! + //foreach (var dc in dnsClients.Values) + //{ + // dc.Dispose(); + //} + //dnsClients.Clear(); dnsClients.TryAdd(dohAddresUri, dnsClient); return dnsClient; } diff --git a/src/BD.WTTS.Client.Plugins.Accelerator/Services.Implementation/NetworkTestService.cs b/src/BD.WTTS.Client.Plugins.Accelerator/Services.Implementation/NetworkTestService.cs index af027c1dc23..18130b1853b 100644 --- a/src/BD.WTTS.Client.Plugins.Accelerator/Services.Implementation/NetworkTestService.cs +++ b/src/BD.WTTS.Client.Plugins.Accelerator/Services.Implementation/NetworkTestService.cs @@ -375,7 +375,13 @@ private async ValueTask GetStunClient5389Async(TransportProtoco DnsQueryAnswerRecord.DnsRecordType dnsRecordType = DnsQueryAnswerRecord.DnsRecordType.A, CancellationToken cancellationToken = default) { - using HttpClient client = new HttpClient(); + var handler = new HttpClientHandler + { + UseCookies = false, + UseProxy = false, + Proxy = HttpNoProxy.Instance, + }; + using HttpClient client = new HttpClient(handler); string queryUrl = $"{dohServer}?name={testDomain}&type={dnsRecordType}"; diff --git a/src/BD.WTTS.Client.Plugins.Accelerator/UI/ViewModels/AcceleratorPageViewModel.cs b/src/BD.WTTS.Client.Plugins.Accelerator/UI/ViewModels/AcceleratorPageViewModel.cs index ec3ee3aeee1..938b825b7f7 100644 --- a/src/BD.WTTS.Client.Plugins.Accelerator/UI/ViewModels/AcceleratorPageViewModel.cs +++ b/src/BD.WTTS.Client.Plugins.Accelerator/UI/ViewModels/AcceleratorPageViewModel.cs @@ -95,7 +95,7 @@ public AcceleratorPageViewModel() DNSCheckCommand = ReactiveCommand.CreateFromTask(async () => { - var testDomain = DomainPendingTest == string.Empty ? "steamcommunity.com" : DomainPendingTest; + var testDomain = DomainPendingTest == string.Empty ? "store.steampowered.com" : DomainPendingTest; try { long delayMs; diff --git a/src/BD.WTTS.Client.Plugins.Accelerator/UI/ViewModels/AcceleratorPageViewModel.props.cs b/src/BD.WTTS.Client.Plugins.Accelerator/UI/ViewModels/AcceleratorPageViewModel.props.cs index 34f9e5f9fe6..7b3773002a3 100644 --- a/src/BD.WTTS.Client.Plugins.Accelerator/UI/ViewModels/AcceleratorPageViewModel.props.cs +++ b/src/BD.WTTS.Client.Plugins.Accelerator/UI/ViewModels/AcceleratorPageViewModel.props.cs @@ -105,7 +105,7 @@ public enum NatTypeSimple [Reactive] public string SelectedSTUNAddress { get; set; } - public List STUNAddress { get; } = + public string[] STUNAddress { get; } = [ "stun.syncthing.net", "stun.hot-chilli.net", diff --git a/src/BD.WTTS.Client.Plugins.Accelerator/UI/Views/Controls/NetworkCheck.axaml b/src/BD.WTTS.Client.Plugins.Accelerator/UI/Views/Controls/NetworkCheck.axaml index bc7906f0bf6..4bbac1ece4d 100644 --- a/src/BD.WTTS.Client.Plugins.Accelerator/UI/Views/Controls/NetworkCheck.axaml +++ b/src/BD.WTTS.Client.Plugins.Accelerator/UI/Views/Controls/NetworkCheck.axaml @@ -33,7 +33,7 @@ -