Skip to content

Commit

Permalink
🐛 多个问题修复调整
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbadmin committed Aug 31, 2024
1 parent d4de20a commit 8ca203f
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 27 deletions.
4 changes: 2 additions & 2 deletions src/BD.WTTS.Client.Avalonia/UI/Styling/Controls/AppItem.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</spp:AppItem>

<spp:AppItem
Title="Wo Long: Fallen Dynasty (卧龙:苍天陨落)"
Title="Wo Long: Fallen Dynasty (卧龙:苍天陨落)(卧龙:苍天陨落)(卧龙:苍天陨落)(卧龙:苍天陨落)"
MaxHeight="120"
Description="This is a description of whatver this does"
Tags="111">
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,13 @@ private async ValueTask<IStunClient5389> 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}";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public enum NatTypeSimple
[Reactive]
public string SelectedSTUNAddress { get; set; }

public List<string> STUNAddress { get; } =
public string[] STUNAddress { get; } =
[
"stun.syncthing.net",
"stun.hot-chilli.net",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</ui:SettingsExpander.Header>
<ui:SettingsExpander.Footer>
<WrapPanel>
<ui:FAComboBox
<ui:FAComboBox
Margin="4"
IsEditable="False"
IsEnabled="{Binding !IsNATChecking}"
Expand All @@ -47,13 +47,13 @@
</ui:FAComboBox.ItemTemplate>
</ui:FAComboBox>
<Button
x:Name="NATCheckButton"
x:FieldModifier="public"
x:Name="NATCheckButton"
Width="100"
Margin="4"
x:FieldModifier="public"
Command="{Binding NATCheckCommand}"
Content="检测"
IsEnabled="True"
Command="{Binding NATCheckCommand}"/>
IsEnabled="True" />
</WrapPanel>
</ui:SettingsExpander.Footer>

Expand Down Expand Up @@ -101,9 +101,9 @@
HorizontalAlignment="Right"
IsVisible="{Binding IsNATChecking}" />
<SelectableTextBlock
Text="{Binding LocalEndPoint}"
Foreground="Gray"
IsVisible="{Binding !IsNATChecking}" />
IsVisible="{Binding !IsNATChecking}"
Text="{Binding LocalEndPoint}" />
</Grid>
</ui:SettingsExpanderItem.Footer>
</ui:SettingsExpanderItem>
Expand Down Expand Up @@ -173,16 +173,43 @@
<Separator Margin="-64,0" Classes="Horizontal" />

<ui:SettingsExpanderItem Margin="-28,0,0,-4" Background="Transparent">
<StackPanel Orientation="Horizontal" Spacing="8">
<TextBlock
VerticalAlignment="Center"
FontWeight="Bold"
Text="相关链接" />
<TextBlock
VerticalAlignment="Center"
FontWeight="Bold"
Text="相关链接" />
</ui:SettingsExpanderItem>

<ui:SettingsExpanderItem Margin="-28,-24,0,-4" Background="Transparent">
<WrapPanel Orientation="Horizontal">
<HyperlinkButton
VerticalAlignment="Center"
Content="解决NAT错误"
Content="XBOX 关于 NAT 文档"
NavigateUri="https://support.xbox.com/zh-CN/help/hardware-network/connect-network/xbox-one-nat-error" />
</StackPanel>
<HyperlinkButton
VerticalAlignment="Center"
Content="Playstation 关于 NAT 文档"
NavigateUri="https://manuals.playstation.net/document/ct/ps4/settings/nw_test.html" />
<HyperlinkButton
VerticalAlignment="Center"
Content="Nintendo Switch 关于 NAT 文档"
NavigateUri="https://www.nintendoswitch.com.cn/support/faq/373.html" />
<HyperlinkButton
VerticalAlignment="Center"
Content="Bungie 关于 NAT 文档"
NavigateUri="https://help.bungie.net/hc/zh-cn/articles/360049496751-%E9%AB%98%E7%BA%A7%E7%96%91%E9%9A%BE%E6%8E%92%E8%A7%A3-%E9%80%9A%E7%94%A8%E5%8D%B3%E6%8F%92%E5%8D%B3%E7%94%A8-%E7%AB%AF%E5%8F%A3%E8%BD%AC%E9%80%81%E4%B8%8E%E7%BD%91%E7%BB%9C%E5%9C%B0%E5%9D%80%E8%BD%AC%E6%8D%A2%E7%B1%BB%E5%9E%8B" />
<HyperlinkButton
VerticalAlignment="Center"
Content="Activision 关于 NAT 文档"
NavigateUri="https://support.activision.com/tw/zh/articles/port-forward-and-nat-faq" />
<HyperlinkButton
VerticalAlignment="Center"
Content="RockStar Games 关于 NAT 文档"
NavigateUri="https://support.rockstargames.com/tw/articles/206210548/%E5%A6%82%E4%BD%95%E8%A7%A3%E6%B1%BA-GTA-%E7%B7%9A%E4%B8%8A%E6%A8%A1%E5%BC%8F%E4%B8%AD%E8%88%87%E5%9A%B4%E6%A0%BC-Strict-NAT-%E9%A1%9E%E5%9E%8B%E7%9B%B8%E9%97%9C%E7%9A%84%E9%8C%AF%E8%AA%A4" />
<HyperlinkButton
VerticalAlignment="Center"
Content="迅游关于 NAT 文档"
NavigateUri="https://cs.xunyou.com/html/282/15271.shtml" />
</WrapPanel>
</ui:SettingsExpanderItem>
</StackPanel>
</ui:SettingsExpander>
Expand All @@ -204,9 +231,9 @@
<ui:SettingsExpander.Footer>
<Button
Width="100"
Command="{Binding DNSCheckCommand}"
Content="检测"
IsEnabled="True"
Command="{Binding DNSCheckCommand}"/>
IsEnabled="True" />
</ui:SettingsExpander.Footer>

<StackPanel Margin="24,0,0,0">
Expand All @@ -224,9 +251,9 @@
<TextBlock Text="待检测的域名" />
<ui:SettingsExpanderItem.Footer>
<TextBox
Text="{Binding DomainPendingTest, Mode=TwoWay}"
Width="200"
Watermark="steamcommunity.com" />
Text="{Binding DomainPendingTest, Mode=TwoWay}"
Watermark="store.steampowered.com" />
</ui:SettingsExpanderItem.Footer>
</ui:SettingsExpanderItem>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
Description="{Binding Description, Source={x:Static s:Plugin.Instance}, Mode=OneWay}"
Subtitle="{Binding Author, Source={x:Static s:Plugin.Instance}, Mode=OneWay, Converter={StaticResource StringFormatConverter}, ConverterParameter=Plugin_Author}"
mc:Ignorable="d">
<spp:PageBase.Styles>
<Style Selector="spp|AppItem /template/ TextBlock#HeaderText">
<Setter Property="Grid.ColumnSpan" Value="0" />
</Style>
</spp:PageBase.Styles>
<spp:PageBase.PreviewImage>
<ui:ImageIconSource Source="avares://BD.WTTS.Client.Plugins.Accelerator/UI/Assets/script.ico" />
</spp:PageBase.PreviewImage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
x:DataType="spp:AuthenticatorItemModel"
Classes.IsActive="{Binding IsSelected}"
mc:Ignorable="d">
<UserControl.Styles>
<Style Selector="spp|AppItem /template/ TextBlock#HeaderText">
<Setter Property="Grid.ColumnSpan" Value="0" />
</Style>
</UserControl.Styles>
<spp:AppItem
Title="{Binding AuthName}"
Description="{Binding AuthData.Created, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
"%LocalAppData%\\Riot Games\\Riot Client\\Data\\Cookies": "Cookies",
"%LocalAppData%\\Riot Games\\Riot Client\\Data\\Sessions": "Sessions",
"%LocalAppData%\\Riot Games\\Riot Client\\Data\\RiotClientPrivateSettings.yaml": "RiotClientPrivateSettings.yaml",
"%LocalAppData%\\Riot Games\\Riot Client\\Data\\RiotGamesPrivateSettings.yaml": "RiotGamesPrivateSettings.yaml",
"%LocalAppData%\\Riot Games\\Riot Client\\Config\\RiotClientSettings.yaml": "RiotClientSettings.yaml",
"%LocalAppData%\\Riot Games\\Riot Client\\WattToolkit.id": "WattToolkit.id"
},
Expand Down Expand Up @@ -177,8 +178,7 @@
"%ProgramData%\\GOG.com\\Galaxy\\webcache\\common\\Session Storage\\*.log": "ProgramData\\Session Storage\\",
"%ProgramData%\\GOG.com\\Galaxy\\webcache\\common\\Session Storage\\*.ldb": "ProgramData\\Session Storage\\",
"%ProgramData%\\GOG.com\\Galaxy\\webcache\\common\\Cookies": "ProgramData\\Cookies",
"%ProgramData%\\GOG.com\\Galaxy\\storage\\etags.db": "ProgramData\\storage\\etags.db",
"%ProgramData%\\GOG.com\\Galaxy\\storage\\galaxy-2.0.db*": "ProgramData\\storage\\",
"%ProgramData%\\GOG.com\\Galaxy\\storage\\*": "ProgramData\\storage\\",
"%ProgramData%\\GOG.com\\Galaxy\\config.json": "ProgramData\\config.json"
},
"ProfilePicPath": "%ProgramData%\\GOG.com\\Galaxy\\webcache\\%UniqueId%\\user\\%LARGEST%.jpg",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,14 @@ public void LoadPlatforms()
{
GamePlatforms?[0].LoadUsers();

if (!OperatingSystem2.IsWindows())
{
AddGamePlatforms = [];
return;
}

var temp = GetSupportPlatforms();
if (temp != null && OperatingSystem2.IsWindows())
if (temp != null)
{
if (GameAccountSettings.EnablePlatforms.Any_Nullable())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
</DataTemplate>
</MenuItem.DataTemplates>-->
</MenuItem>
<MenuItem Header="-" />
<MenuItem Header="-" IsVisible="{Binding !!AddGamePlatforms.Count}" />
<MenuItem Command="{Binding LoginNewCommand}" Header="{Binding Path=Res.UserChange_LoginNewAccount, Mode=OneWay, Source={x:Static s:ResourceService.Current}}">
<MenuItem.Icon>
<ui:SymbolIcon Symbol="Add" />
Expand Down

0 comments on commit 8ca203f

Please sign in to comment.