Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions SS14.Launcher/LauncherMessaging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,12 @@ private async Task ServerTask(LauncherCommands lc)
if (token.IsCancellationRequested) break;
try
{
while (!sr.EndOfStream)
while (true)
{
// Can't be cancelled
var line = await sr.ReadLineAsync().WaitAsync(token).ConfigureAwait(false);
var line = await sr.ReadLineAsync(token).ConfigureAwait(false);
// null means the client disconnected (end of stream).
if (line == null)
continue;
break;

if (line.StartsWith(LauncherCommands.VersionPrefix))
await AnswerVersion(line, lc);
Expand Down
4 changes: 3 additions & 1 deletion SS14.Launcher/Models/Data/TypeHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ public override DateTimeOffset Parse(object value)

public sealed class UriTypeHandler : SqlMapper.TypeHandler<Uri>
{
public override void SetValue(IDbDataParameter parameter, Uri value)
public override void SetValue(IDbDataParameter parameter, Uri? value)
{
ArgumentNullException.ThrowIfNull(value);

if (!value.IsAbsoluteUri)
throw new ArgumentException("Refusing to store relative URI to database");

Expand Down
2 changes: 1 addition & 1 deletion SS14.Launcher/Models/Logins/LoggedInAccount.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace SS14.Launcher.Models.Logins;

public abstract class LoggedInAccount : ObservableObject
{
public string Username => LoginInfo.Username;
public string Username => LoginInfo.Username!;
public Guid UserId => LoginInfo.UserId;

protected LoggedInAccount(LoginInfo loginInfo)
Expand Down
6 changes: 3 additions & 3 deletions SS14.Launcher/Theme/ThemeTextBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ Taken & modified from Avalonia's git repo.
<TextBlock Name="floatingWatermark"
Foreground="{DynamicResource ThemeAccentBrush}"
FontSize="{DynamicResource FontSizeSmall}"
Text="{TemplateBinding Watermark}"
Text="{TemplateBinding PlaceholderText}"
DockPanel.Dock="Top">
<TextBlock.IsVisible>
<MultiBinding Converter="{x:Static BoolConverters.And}">
<Binding RelativeSource="{RelativeSource TemplatedParent}"
Path="UseFloatingWatermark" />
Path="UseFloatingPlaceholder" />
<Binding RelativeSource="{RelativeSource TemplatedParent}"
Path="Text"
Converter="{x:Static StringConverters.IsNotNullOrEmpty}" />
Expand All @@ -33,7 +33,7 @@ Taken & modified from Avalonia's git repo.
<Panel>
<TextBlock Name="watermark"
Opacity="0.5"
Text="{TemplateBinding Watermark}"
Text="{TemplateBinding PlaceholderText}"
IsVisible="{TemplateBinding Text, Converter={x:Static StringConverters.IsNullOrEmpty}}" />
<TextPresenter Name="PART_TextPresenter"
Text="{TemplateBinding Text, Mode=TwoWay}"
Expand Down
2 changes: 2 additions & 0 deletions SS14.Launcher/Utility/DynamicDataExt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public static bool TryLookup<TValue, TKey>(
this IObservableCache<TValue, TKey> cache,
TKey key,
[MaybeNullWhen(false)] out TValue value)
where TValue : notnull
where TKey : notnull
{
var option = cache.Lookup(key);
Expand All @@ -26,6 +27,7 @@ public static bool TryLookup<TValue, TKey>(
this SourceCache<TValue, TKey> cache,
TKey key,
[MaybeNullWhen(false)] out TValue value)
where TValue : notnull
where TKey : notnull
{
var option = cache.Lookup(key);
Expand Down
2 changes: 1 addition & 1 deletion SS14.Launcher/ViewModels/AccountDropDownViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@ public string StatusText

public AvailableAccountViewModel(LoggedInAccount account)
{
Account = account;
_account = account;
}
}
3 changes: 1 addition & 2 deletions SS14.Launcher/ViewModels/MainWindowTabs/HomePageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@ public HomePageViewModel(MainWindowViewModel mainWindowViewModel)
})
// Removed favorites must not keep being refreshed (and queried) from the cache.
.OnItemRemoved(a => _statusCache.Remove(a.CacheData.Address))
.Sort(Comparer<ServerEntryViewModel>.Create((a, b) => {
.SortAndBind(out var favorites, Comparer<ServerEntryViewModel>.Create((a, b) => {
var dc = a.Favorite!.RaiseTime.CompareTo(b.Favorite!.RaiseTime);
if (dc != 0)
{
return -dc;
}
return string.Compare(a.Name, b.Name, StringComparison.CurrentCultureIgnoreCase);
}))
.Bind(out var favorites)
.Subscribe(_ =>
{
FavoritesEmpty = favorites.Count == 0;
Expand Down
4 changes: 2 additions & 2 deletions SS14.Launcher/Views/AddFavoriteDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
<Grid Margin="4" ColumnDefinitions="Auto,*" RowDefinitions="Auto,Auto">
<TextBlock VerticalAlignment="Center" Margin="0,0,4,0" Grid.Column="0" Grid.Row="0" Text="{loc:Loc add-favorite-window-label-name}" />
<TextBlock VerticalAlignment="Center" Margin="0,0,4,0" Grid.Column="0" Grid.Row="1" Text="{loc:Loc add-favorite-window-label-address}" />
<TextBox Grid.Column="1" Grid.Row="0" Name="NameBox" Watermark="{loc:Loc add-favorite-window-name-hint}"
<TextBox Grid.Column="1" Grid.Row="0" Name="NameBox" PlaceholderText="{loc:Loc add-favorite-window-name-hint}"
TextChanged="UpdateSubmitValid" />
<TextBox Grid.Column="1" Grid.Row="1" Name="AddressBox" Watermark="ss14://example.com"
<TextBox Grid.Column="1" Grid.Row="1" Name="AddressBox" PlaceholderText="ss14://example.com"
TextChanged="UpdateSubmitValid" />
</Grid>
</DockPanel>
Expand Down
2 changes: 1 addition & 1 deletion SS14.Launcher/Views/DirectConnectDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
<TextBlock Name="InvalidLabel" Text="{loc:Loc direct-connect-address-invalid}" VerticalAlignment="Center" />
</DockPanel>

<TextBox Name="AddressBox" Watermark="ss14://example.com:1212" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" />
<TextBox Name="AddressBox" PlaceholderText="ss14://example.com:1212" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" />
</DockPanel>
</Window>
2 changes: 1 addition & 1 deletion SS14.Launcher/Views/HubSettingsDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
</Button>
<TextBox Text="{Binding Address}"
PropertyChanged="HubTextChanged"
Watermark="https://example.com/hub/"
PlaceholderText="https://example.com/hub/"
IsEnabled="{Binding IsNotDefault}" />
</DockPanel>
</DataTemplate>
Expand Down
2 changes: 1 addition & 1 deletion SS14.Launcher/Views/Login/AuthTfaView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
Text="{loc:Loc login-2fa-message}" />

<TextBox DockPanel.Dock="Top" Name="CodeBox" MaxWidth="300" Margin="0, 20, 0, 0"
Watermark="{loc:Loc login-2fa-input-watermark}"
PlaceholderText="{loc:Loc login-2fa-input-watermark}"
Text="{Binding Code}" IsEnabled="{Binding !Busy}" />

<DockPanel DockPanel.Dock="Top" LastChildFill="False" MaxWidth="300" Margin="0 20 0 0">
Expand Down
2 changes: 1 addition & 1 deletion SS14.Launcher/Views/Login/ExpiredLoginView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<TextBox DockPanel.Dock="Top" Name="NameBox" MaxWidth="300" Margin="0, 10, 0, 0"
Text="{Binding Account.Username}" IsEnabled="False" />

<TextBox DockPanel.Dock="Top" Name="PasswordBox" MaxWidth="300" Margin="0, 4, 0, 0" Watermark="{loc:Loc login-expired-message}"
<TextBox DockPanel.Dock="Top" Name="PasswordBox" MaxWidth="300" Margin="0, 4, 0, 0" PlaceholderText="{loc:Loc login-expired-message}"
Text="{Binding Password}" PasswordChar="•" />

<DockPanel DockPanel.Dock="Top" LastChildFill="False" MaxWidth="300" Margin="0 20 0 0">
Expand Down
4 changes: 2 additions & 2 deletions SS14.Launcher/Views/Login/LoginView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
Text="{loc:Loc login-login-auth-server-changed}" IsVisible="{Binding Source={x:Static local:ConfigConstants.IsAuthOverride}}" />

<TextBox DockPanel.Dock="Top" Name="NameBox" MaxWidth="300" Margin="0, 10, 0, 0"
Watermark="{loc:Loc login-login-username-watermark}"
PlaceholderText="{loc:Loc login-login-username-watermark}"
Text="{Binding Username}" IsEnabled="{Binding !Busy}" />

<TextBox DockPanel.Dock="Top" Name="PasswordBox" MaxWidth="300" Margin="0, 4, 0, 0"
Watermark="{loc:Loc login-login-password-watermark}"
PlaceholderText="{loc:Loc login-login-password-watermark}"
Text="{Binding Password}"
PasswordChar="•"
IsEnabled="{Binding !Busy}" />
Expand Down
4 changes: 2 additions & 2 deletions SS14.Launcher/Views/MainWindowTabs/ServerListTabView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<ToggleButton DockPanel.Dock="Right" IsChecked="{Binding FiltersVisible}" Classes="OpenRight"
Content="{Binding Filters.FiltersText}" />
<TextBox DockPanel.Dock="Right" Text="{Binding SearchString, Mode=TwoWay}"
Watermark="{loc:Loc tab-servers-search-watermark}"
UseFloatingWatermark="False"
PlaceholderText="{loc:Loc tab-servers-search-watermark}"
UseFloatingPlaceholder="False"
Margin="0 0 8 0" />
</DockPanel>

Expand Down
Loading