Skip to content
Open
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
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<PackageVersion Include="Avalonia.ReactiveUI" Version="11.2.4"/>
<PackageVersion Include="Avalonia.Diagnostics" Version="11.2.4"/>
<PackageVersion Include="Avalonia.Themes.Simple" Version="11.2.4"/>
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.2.4"/>
<PackageVersion Include="CodeHollow.FeedReader" Version="1.2.6"/>
<PackageVersion Include="Dapper" Version="2.0.123"/>
<PackageVersion Include="DynamicData" Version="8.4.1"/>
Expand Down
6 changes: 3 additions & 3 deletions SS14.Launcher/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

<Application.Styles>
<StyleInclude Source="avares://Avalonia.Themes.Simple/SimpleTheme.xaml" />
<StyleInclude Source="/Theme/Theme.xaml" />
<StyleInclude Source="/Theme/ThemeResources.xaml" />
<StyleInclude Source="/Theme/Theme.xaml" />
<StyleInclude Source="/Theme/ThemeAngleBox.xaml" />
<StyleInclude Source="/Theme/ThemeTabControl.xaml" />
<StyleInclude Source="/Theme/ThemeTabItem.xaml" />
Expand All @@ -23,10 +23,10 @@
<StyleInclude Source="/Theme/ThemeWindow.xaml" />
<!-- I'm too lazy to fix the styling on those text boxes so this is staying commented out for now. -->
<!--<StyleInclude Source="/Theme/ThemeTextBox.xaml"/>-->
<StyleInclude Source="/Theme/ThemeServerList.axaml" />
<StyleInclude Source="/Theme/ThemeCheckBox.axaml" />
<StyleInclude Source="/Theme/ThemeIconLabel.xaml" />
<StyleInclude Source="/Theme/ThemeRandomMessage.xaml" />
<StyleInclude Source="/Theme/ThemeTimerTextCell.xaml" />
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Simple.xaml" />
<StyleInclude Source="/Theme/ThemeServerList.axaml" />
</Application.Styles>
</Application>
6 changes: 1 addition & 5 deletions SS14.Launcher/Assets/Locale/el/text.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -542,8 +542,4 @@ connecting-privacy-policy-decline = Δεν αποδέχομαι (αποσύνδ
tab-servers-table-round-time = Χρόνος
server-entry-status-lobby = Λόμπι
connecting-status-update-error-unknown = Άγνωστο
server-entry-round-time =
{ $hours ->
[0] { $mins }M
*[1] { $hours }H { $mins }M
}
server-entry-round-time = { $hours }h { $mins }m
5 changes: 1 addition & 4 deletions SS14.Launcher/Assets/Locale/en-US/text.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,7 @@ server-entry-player-count =
[0] ∞
*[1] { $max }
}
server-entry-round-time = { $hours ->
[0] { $mins }M
*[1] { $hours }H { $mins }M
}
server-entry-round-time = { $hours }h { $mins }m
server-entry-fetching = Fetching…
server-entry-description-offline = Unable to contact server
server-entry-description-fetching = Fetching server status…
Expand Down
6 changes: 1 addition & 5 deletions SS14.Launcher/Assets/Locale/nl/text.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -540,10 +540,6 @@ connecting-privacy-policy-view = Bekijk privacybeleid
connecting-privacy-policy-accept = Accepteer (doorgaan)
connecting-privacy-policy-decline = Weigeren (verbreken)
tab-servers-table-round-time = Tijd
server-entry-round-time =
{ $hours ->
[0] { $mins }M
*[1] { $hours }U { $mins }M
}
server-entry-round-time = { $hours }u { $mins }m
server-entry-status-lobby = Lobby
connecting-status-update-error-unknown = Onbekend
6 changes: 1 addition & 5 deletions SS14.Launcher/Assets/Locale/pl/text.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,7 @@ connecting-status-update-error-unknown = Nieznany
server-entry-status-lobby = Menu
connecting-privacy-policy-text = Ten serwer wymaga zaakceptowania swojej polityki prywatności przed połączeniem.
tab-servers-table-round-time = Czas
server-entry-round-time =
{ $hours ->
[0] { $mins }M
*[1] { $hours }G { $mins }M
}
server-entry-round-time = { $hours }g { $mins }m
connecting-privacy-policy-text-version-changed = Ten serwer zaktualizował swoją politykę prywatności od twojej ostatniej rozgrywki. Musisz zaakceptować nową wersję przed połączeniem.
connecting-privacy-policy-view = Pokaż politykę prywatności
connecting-privacy-policy-accept = Zaakceptuj (kontynuuj)
Expand Down
6 changes: 1 addition & 5 deletions SS14.Launcher/Assets/Locale/ru/text.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,7 @@ connecting-privacy-policy-text = Перед подключением к этом
connecting-privacy-policy-view = Посмотреть политику конфиденциальности
connecting-privacy-policy-accept = Принять (продолжить)
connecting-privacy-policy-decline = Отклонить (отключиться)
server-entry-round-time =
{ $hours ->
[0] { $mins }м
*[1] { $hours }ч { $mins }м
}
server-entry-round-time = { $hours }ч { $mins }м
tab-servers-table-round-time = Время
connecting-status-update-error-unknown = Неизвестно
server-entry-status-lobby = Лобби
Expand Down
6 changes: 1 addition & 5 deletions SS14.Launcher/Assets/Locale/tr/text.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -541,11 +541,7 @@ connecting-privacy-policy-text-version-changed = Bu sunucu son oynadığınızda
connecting-privacy-policy-accept = Kabul et (devam et)
connecting-privacy-policy-decline = Reddet (bağlantıyı kes)
tab-servers-table-round-time = Zaman
server-entry-round-time =
{ $hours ->
[0] { $mins }M
*[1] { $hours }H { $mins }M
}
server-entry-round-time = { $hours }h { $mins }m
server-entry-status-lobby = Lobi
connecting-status-update-error-unknown = Bilinmeyen
connecting-status-update-error-no-engine-for-platform = Bu oyun platformunuzu desteklemeyen eski bir versiyon kullanmaktadır. Lütfen farklı bir sunucu deneyiniz ya da yeniden deneyiniz.
Expand Down
6 changes: 1 addition & 5 deletions SS14.Launcher/Assets/Locale/uk/text.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -540,11 +540,7 @@ connecting-privacy-policy-text-version-changed = Цей сервер онови
connecting-privacy-policy-view = Переглянути політику конфіденційності
connecting-privacy-policy-accept = Прийняти (продовжити)
connecting-privacy-policy-decline = Відхилити (відключитися)
server-entry-round-time =
{ $hours ->
[0] { $mins }хв
*[1] { $hours }г { $mins }хв
}
server-entry-round-time = { $hours }г { $mins }хв
tab-servers-table-round-time = Час
server-entry-status-lobby = Лоббі
connecting-status-update-error-unknown = Невідомо
Expand Down
6 changes: 1 addition & 5 deletions SS14.Launcher/Assets/Locale/zh_Hans/text.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,7 @@ connecting-privacy-policy-view = 查看隐私条款
connecting-privacy-policy-accept = 同意(继续)
connecting-privacy-policy-decline = 拒绝(断开连接)
login-login-show-password = 显示密码
server-entry-round-time =
{ $hours ->
[0] { $mins }分
*[1] { $hours }时 { $mins }分
}
server-entry-round-time = { $hours }时 { $mins }分
connecting-status-update-error-unknown = 未知
tab-servers-table-round-time = 时间
server-entry-status-lobby = 大厅
Expand Down
94 changes: 0 additions & 94 deletions SS14.Launcher/Controls/TimerTextCell.xaml.cs

This file was deleted.

2 changes: 0 additions & 2 deletions SS14.Launcher/Models/ServerStatus/IServerStatusData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,5 @@ public interface IServerStatusData : INotifyPropertyChanged

int SoftMaxPlayerCount { get; set; }

DateTime? RoundStartTime { get; set; }

GameRoundStatus RoundStatus { get; set; }
}
6 changes: 0 additions & 6 deletions SS14.Launcher/Models/ServerStatus/ServerStatusCache.Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
private TimeSpan? _ping;
private int _playerCount;
private int _softMaxPlayerCount;
private DateTime? _roundStartTime;

Check warning on line 14 in SS14.Launcher/Models/ServerStatus/ServerStatusCache.Data.cs

View workflow job for this annotation

GitHub Actions / build

The field 'ServerStatusData._roundStartTime' is never used
private GameRoundStatus _roundStatus;
private ServerStatusCode _status = ServerStatusCode.FetchingStatus;
private ServerStatusInfoCode _statusInfo = ServerStatusInfoCode.NotFetched;
private ServerInfoLink[]? _links;
private string[] _tags = Array.Empty<string>();

public ServerStatusData(string address)

Check warning on line 21 in SS14.Launcher/Models/ServerStatus/ServerStatusCache.Data.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field '_roundStatus' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
{
Address = address;
}

public ServerStatusData(string address, string hubAddress)

Check warning on line 26 in SS14.Launcher/Models/ServerStatus/ServerStatusCache.Data.cs

View workflow job for this annotation

GitHub Actions / build

Non-nullable field '_roundStatus' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the field as nullable.
{
Address = address;
HubAddress = hubAddress;
Expand Down Expand Up @@ -79,12 +79,6 @@
set => SetProperty(ref _softMaxPlayerCount, value);
}

public DateTime? RoundStartTime
{
get => _roundStartTime;
set => SetProperty(ref _roundStartTime, value);
}

public GameRoundStatus RoundStatus
{
get => _roundStatus;
Expand Down
14 changes: 5 additions & 9 deletions SS14.Launcher/Models/ServerStatus/ServerStatusCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,19 @@ public static void ApplyStatus(ServerStatusData data, ServerApi.ServerStatus sta

switch (status.RunLevel)
{
case ServerApi.GameRunLevel.InRound:
data.RoundStatus = GameRoundStatus.InRound;
case ServerApi.GameRunLevel.InRound when status.RoundStartTime is { } start:
var roundStartTime = DateTime.Parse(start, null, System.Globalization.DateTimeStyles.RoundtripKind);
data.RoundStatus = new InRound(roundStartTime);
break;
case ServerApi.GameRunLevel.PostRound:
case ServerApi.GameRunLevel.PreRoundLobby:
data.RoundStatus = GameRoundStatus.InLobby;
data.RoundStatus = new InLobby();
break;
default:
data.RoundStatus = GameRoundStatus.Unknown;
data.RoundStatus = new Unknown();
break;
}

if (status.RoundStartTime != null)
{
data.RoundStartTime = DateTime.Parse(status.RoundStartTime, null, System.Globalization.DateTimeStyles.RoundtripKind);
}

var baseTags = status.Tags ?? Array.Empty<string>();
var inferredTags = ServerTagInfer.InferTags(status);

Expand Down
31 changes: 27 additions & 4 deletions SS14.Launcher/Models/ServerStatus/ServerStatusCode.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System;

namespace SS14.Launcher.Models.ServerStatus;

public enum ServerStatusCode
Expand All @@ -15,9 +17,30 @@ public enum ServerStatusInfoCode
Fetched
}

public enum GameRoundStatus
public abstract record GameRoundStatus : IComparable<GameRoundStatus>
{
public int CompareTo(GameRoundStatus? other)
=> (this, other) switch
{
(InRound a, InRound b) => a.TimeElapsed.CompareTo(b.TimeElapsed),
({ } a, { } b) => Ordering(a).CompareTo(Ordering(b)),
_ => 1,
};

private static int Ordering(GameRoundStatus status)
=> status switch
{
Unknown => 0,
InLobby => 1,
InRound => 2,
_ => throw new ArgumentOutOfRangeException(nameof(status), status, "You should add an ordering value"),
};
}

public record Unknown : GameRoundStatus;
public record InLobby : GameRoundStatus;

public record InRound(DateTime RoundStartTime) : GameRoundStatus
{
Unknown,
InLobby,
InRound,
public TimeSpan TimeElapsed => DateTime.UtcNow.Subtract(RoundStartTime);
}
1 change: 1 addition & 0 deletions SS14.Launcher/SS14.Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<ItemGroup>
<PackageReference Include="Avalonia" />
<PackageReference Include="Avalonia.Desktop" />
<PackageReference Include="Avalonia.Controls.DataGrid" />
<PackageReference Include="Avalonia.ReactiveUI" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="HotAvalonia" PrivateAssets="All" />
Expand Down
2 changes: 1 addition & 1 deletion SS14.Launcher/Theme/Theme.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

<Style Selector="Panel.ScrollViewerSep">
<Setter Property="Background">
<SolidColorBrush Color="#2e2e35" />
<SolidColorBrush Color="{StaticResource ThemeServerSeparatorColor}" />
</Setter>
<Setter Property="MinHeight" Value="1" />
</Style>
Expand Down
13 changes: 10 additions & 3 deletions SS14.Launcher/Theme/ThemeResources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
<Color x:Key="ThemePopupBackgroundColor">#202025</Color>
<Color x:Key="ThemeForegroundColor">#EEEEEE</Color>

<Color x:Key="ThemeStripeDark">#1E1E22</Color>
<Color x:Key="ThemeStripeBright">#262626</Color>

<Color x:Key="ThemeForegroundMutedColor">#666</Color>

<Color x:Key="ThemeControlLowColor">#2E2E35</Color>
<Color x:Key="ThemeControlMidColor">#464966</Color>
<Color x:Key="ThemeControlHighColor">#3E6C45</Color>

Expand All @@ -22,11 +26,14 @@
<Color x:Key="ThemeListSeparatorColor">#AA575B7F</Color>
<Color x:Key="ThemeListSeparatorColorTransparent">#00575B7F</Color>

<Color x:Key="ThemeServerSeparatorColor">#2E2E35</Color>

<SolidColorBrush x:Key="ThemeBackgroundBrush" Color="{StaticResource ThemeBackgroundColor}" />
<SolidColorBrush x:Key="ThemePopupBackgroundBrush" Color="{StaticResource ThemePopupBackgroundColor}" />
<SolidColorBrush x:Key="ThemeForegroundBrush" Color="{StaticResource ThemeForegroundColor}" />
<SolidColorBrush x:Key="ThemeForegroundMutedBrush" Color="{StaticResource ThemeForegroundMutedColor}" />

<SolidColorBrush x:Key="ThemeControlLowBrush" Color="{StaticResource ThemeControlLowColor}" />
<SolidColorBrush x:Key="ThemeControlMidBrush" Color="{StaticResource ThemeControlMidColor}" />
<SolidColorBrush x:Key="ThemeControlHighBrush" Color="{StaticResource ThemeControlHighColor}" />

Expand All @@ -42,9 +49,9 @@

<VisualBrush x:Key="ThemeStripeBackBrush">
<VisualBrush.Visual>
<Panel Height="32" Width="32" Background="#1e1e22">
<Path Data="M 0 8 L 24 32 L 8 32 L 0 24 Z" Fill="#262626" />
<Path Data="M 8 0 L 24 0 L 32 8 L 32 24 Z" Fill="#262626" />
<Panel Height="32" Width="32" Background="{StaticResource ThemeStripeDark}">
<Path Data="M 0 8 L 24 32 L 8 32 L 0 24 Z" Fill="{StaticResource ThemeStripeBright}" />
<Path Data="M 8 0 L 24 0 L 32 8 L 32 24 Z" Fill="{StaticResource ThemeStripeBright}" />
</Panel>
</VisualBrush.Visual>

Expand Down
Loading
Loading