TESTERS WANTED: RyuLDN implementation (#65)

These changes allow players to matchmake for local wireless using a LDN
server. The network implementation originates from Berry's public TCP
RyuLDN fork. Logo and unrelated changes have been removed.

Additionally displays LDN game status in the game selection window when
RyuLDN is enabled.

Functionality is only enabled while network mode is set to "RyuLDN" in
the settings.
This commit is contained in:
Vudjun 2024-11-11 22:06:50 +00:00 committed by GitHub
parent abfcfcaf0f
commit 6d8738c048
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
93 changed files with 4100 additions and 189 deletions

View file

@ -1,4 +1,4 @@
<UserControl
<UserControl
x:Class="Ryujinx.Ava.UI.Views.Settings.SettingsNetworkView"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@ -36,11 +36,57 @@
<ComboBoxItem>
<TextBlock Text="{ext:Locale MultiplayerModeDisabled}" />
</ComboBoxItem>
<ComboBoxItem>
<TextBlock Text="{ext:Locale MultiplayerModeLdnRyu}" />
</ComboBoxItem>
<ComboBoxItem>
<TextBlock Text="{ext:Locale MultiplayerModeLdnMitm}" />
</ComboBoxItem>
</ComboBox>
<CheckBox Margin="10,0,0,0" IsChecked="{Binding DisableP2P}">
<TextBlock Text="{ext:Locale MultiplayerDisableP2P}"
ToolTip.Tip="{ext:Locale MultiplayerDisableP2PTooltip}" />
</CheckBox>
</StackPanel>
<StackPanel Margin="10,0,0,0" Orientation="Horizontal">
<TextBlock VerticalAlignment="Center"
Text="{ext:Locale LdnPassphrase}"
ToolTip.Tip="{ext:Locale LdnPassphraseTooltip}"
Width="200" />
<TextBox Name="LdnPassphrase"
Text="{Binding LdnPassphrase}"
Width="250"
MaxLength="16"
ToolTip.Tip="{ext:Locale LdnPassphraseInputTooltip}"
Watermark="{ext:Locale LdnPassphraseInputPublic}" />
<Button
Name="GenLdnPassButton"
Grid.Column="1"
MinWidth="90"
Margin="10,0,0,0"
ToolTip.Tip="{ext:Locale GenLdnPassTooltip}"
Click="GenLdnPassButton_OnClick">
<TextBlock HorizontalAlignment="Center"
Text="{ext:Locale GenLdnPass}" />
</Button>
<Button
Name="ClearLdnPassButton"
Grid.Column="1"
MinWidth="90"
Margin="10,0,0,0"
ToolTip.Tip="{ext:Locale ClearLdnPassTooltip}"
Click="ClearLdnPassButton_OnClick">
<TextBlock HorizontalAlignment="Center"
Text="{ext:Locale ClearLdnPass}" />
</Button>
</StackPanel>
<TextBlock Margin="10,0,0,0"
VerticalAlignment="Center"
Name="InvalidLdnPassphraseBlock"
FontStyle="Italic"
IsVisible="{Binding IsInvalidLdnPassphraseVisible}"
Focusable="False"
Text="{ext:Locale InvalidLdnPassphrase}" />
<Separator Height="1" />
<TextBlock Classes="h1" Text="{ext:Locale SettingsTabNetworkConnection}" />
<CheckBox Margin="10,0,0,0" IsChecked="{Binding EnableInternetAccess}">

View file

@ -1,12 +1,29 @@
using Avalonia.Controls;
using Avalonia.Interactivity;
using Ryujinx.Ava.UI.ViewModels;
using System;
namespace Ryujinx.Ava.UI.Views.Settings
{
public partial class SettingsNetworkView : UserControl
{
public SettingsViewModel ViewModel;
public SettingsNetworkView()
{
InitializeComponent();
}
private void GenLdnPassButton_OnClick(object sender, RoutedEventArgs e)
{
byte[] code = new byte[4];
new Random().NextBytes(code);
ViewModel.LdnPassphrase = $"Ryujinx-{BitConverter.ToUInt32(code):x8}";
}
private void ClearLdnPassButton_OnClick(object sender, RoutedEventArgs e)
{
ViewModel.LdnPassphrase = "";
}
}
}