Skip to content

Commit dd71475

Browse files
committed
Fix merge conflicts
1 parent 2f3a946 commit dd71475

56 files changed

Lines changed: 1620 additions & 962 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Directory.Packages.props

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
<!-- Loader -->
1616
<PackageVersion Include="Robust.Natives" Version="0.1.1"/>
1717
<!-- Launcher -->
18-
<PackageVersion Include="Avalonia" Version="11.0.5"/>
19-
<PackageVersion Include="Avalonia.Desktop" Version="11.0.5"/>
20-
<PackageVersion Include="Avalonia.Diagnostics" Version="11.0.5"/>
21-
<PackageVersion Include="Avalonia.Themes.Simple" Version="11.0.5"/>
18+
<PackageVersion Include="Avalonia" Version="11.2.4"/>
19+
<PackageVersion Include="Avalonia.Desktop" Version="11.2.4"/>
20+
<PackageVersion Include="Avalonia.Diagnostics" Version="11.2.4"/>
21+
<PackageVersion Include="Avalonia.Themes.Simple" Version="11.2.4"/>
22+
<PackageVersion Include="Avalonia.Markup.Xaml.Loader" Version="11.2.4" />
2223
<PackageVersion Include="CodeHollow.FeedReader" Version="1.2.6"/>
2324
<PackageVersion Include="Dapper" Version="2.0.123"/>
24-
<PackageVersion Include="DynamicData" Version="7.13.1"/>
25+
<PackageVersion Include="DynamicData" Version="8.4.1"/>
2526
<PackageVersion Include="Microsoft.Toolkit.Mvvm" Version="7.1.2"/>
2627
<PackageVersion Include="Robust.Shared.AuthLib" Version="0.1.2"/>
2728
<PackageVersion Include="Serilog" Version="2.12.0"/>
@@ -40,5 +41,8 @@
4041
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.5.0"/>
4142
<!-- Bootstrap -->
4243
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3"/>
44+
<!-- Development -->
45+
<PackageVersion Include="HotAvalonia" Version="2.1.0" />
46+
<PackageVersion Include="HotAvalonia.Extensions" Version="2.1.0" PrivateAssets="All" />
4347
</ItemGroup>
4448
</Project>

Launcher.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
4. build-test.yml GitHub Actions workflow
1010
-->
1111
<TargetFramework>net9.0</TargetFramework>
12-
<Version>0.30.2</Version>
12+
<Version>0.31.0</Version>
1313

1414
<!--
1515
CET breaks for people on older, but still supported Windows versions:

Readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# SS14.Launcher
22

3+
<a href="https://weblate.spacestation14.com/engage/space-station-14-launcher/">
4+
<img src="https://weblate.spacestation14.com/widget/space-station-14-launcher/main/svg-badge.svg" alt="Translation status" />
5+
</a>
6+
37
This is the launcher you should be using to connect to SS14 servers. Server browser, content downloads, account management. It's got it all!
48

59
# Development

SS14.Launcher/Api/AuthApi.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using Serilog;
1111
using SS14.Launcher.Models;
1212
using SS14.Launcher.Models.Data;
13+
using SS14.Launcher.Utility;
1314

1415
namespace SS14.Launcher.Api;
1516

@@ -257,9 +258,12 @@ public async Task<bool> CheckTokenAsync(string token)
257258
{
258259
var authUrl = ConfigConstants.AuthUrl + "api/auth/ping";
259260

260-
using var requestMessage = new HttpRequestMessage(HttpMethod.Get, authUrl);
261-
requestMessage.Headers.Authorization = new AuthenticationHeaderValue("SS14Auth", token);
262-
using var resp = await _httpClient.SendAsync(requestMessage);
261+
using var resp = await authUrl.SendAsync(_httpClient, url =>
262+
{
263+
var requestMessage = new HttpRequestMessage(HttpMethod.Get, url);
264+
requestMessage.Headers.Authorization = new AuthenticationHeaderValue("SS14Auth", token);
265+
return requestMessage;
266+
});
263267

264268
if (resp.IsSuccessStatusCode)
265269
{

SS14.Launcher/Api/HubApi.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
using System;
22
using System.IO;
3+
using System.Linq;
34
using System.Net.Http;
45
using System.Net.Http.Json;
56
using System.Text.Json;
67
using System.Threading;
78
using System.Threading.Tasks;
89
using SS14.Launcher.Models;
10+
using SS14.Launcher.Utility;
911

1012
namespace SS14.Launcher.Api;
1113

@@ -18,13 +20,15 @@ public HubApi(HttpClient http)
1820
_http = http;
1921
}
2022

21-
public async Task<ServerListEntry[]> GetServers(Uri hubUri, CancellationToken cancel)
23+
public async Task<ServerListEntry[]> GetServers(UrlFallbackSet hubUri, CancellationToken cancel)
2224
{
2325
// Sanity check, this should be enforced with code
24-
if (!hubUri.AbsoluteUri.EndsWith('/'))
26+
if (!hubUri.Urls.All(u => u.EndsWith('/')))
2527
throw new Exception("URI doesn't have trailing slash");
2628

27-
return await _http.GetFromJsonAsync<ServerListEntry[]>(new Uri(hubUri, "api/servers"), cancel)
29+
var finalUrl = hubUri + "api/servers";
30+
31+
return await finalUrl.GetFromJsonAsync<ServerListEntry[]>(_http, cancel)
2832
?? throw new JsonException("Server list is null!");
2933
}
3034

SS14.Launcher/Api/ServerApi.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,17 @@ public sealed record ServerStatus(
1313
int PlayerCount,
1414
[property: JsonPropertyName("soft_max_players")]
1515
int SoftMaxPlayerCount,
16+
[property: JsonPropertyName("round_start_time")] string? RoundStartTime,
17+
[property: JsonPropertyName("run_level")] GameRunLevel? RunLevel,
1618
[property: JsonPropertyName("tags")] string[]? Tags);
1719

20+
public enum GameRunLevel
21+
{
22+
PreRoundLobby = 0,
23+
InRound = 1,
24+
PostRound = 2
25+
}
26+
1827
/// <summary>
1928
/// Contains definitions for standard tags returned by game servers.
2029
/// </summary>

SS14.Launcher/App.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Application xmlns="https://github.com/avaloniaui"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:local="clr-namespace:SS14.Launcher"
4+
Name="Space Station 14 Launcher"
45
x:Class="SS14.Launcher.App">
56
<Application.DataTemplates>
67
<local:ViewLocator />
@@ -26,5 +27,6 @@
2627
<StyleInclude Source="/Theme/ThemeCheckBox.axaml" />
2728
<StyleInclude Source="/Theme/ThemeIconLabel.xaml" />
2829
<StyleInclude Source="/Theme/ThemeRandomMessage.xaml" />
30+
<StyleInclude Source="/Theme/ThemeTimerTextCell.xaml" />
2931
</Application.Styles>
3032
</Application>

SS14.Launcher/App.xaml.cs

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,24 @@
11
using System;
22
using System.Collections.Generic;
33
using System.IO;
4+
using System.Threading.Tasks;
45
using Avalonia;
56
using Avalonia.Controls;
7+
using Avalonia.Controls.ApplicationLifetimes;
68
using Avalonia.Markup.Xaml;
79
using Avalonia.Media.Imaging;
810
using Avalonia.Platform;
11+
using HotAvalonia;
912
using JetBrains.Annotations;
1013
using Serilog;
14+
using Splat;
15+
using SS14.Launcher.Localization;
16+
using SS14.Launcher.Models;
17+
using SS14.Launcher.Models.ContentManagement;
1118
using SS14.Launcher.Models.OverrideAssets;
19+
using SS14.Launcher.Utility;
20+
using SS14.Launcher.ViewModels;
21+
using SS14.Launcher.Views;
1222

1323
namespace SS14.Launcher;
1424

@@ -38,6 +48,7 @@ public App(OverrideAssetsManager overrideAssets)
3848

3949
public override void Initialize()
4050
{
51+
this.EnableHotReload();
4152
AvaloniaXamlLoader.Load(this);
4253

4354
LoadBaseAssets();
@@ -100,4 +111,56 @@ private enum AssetType
100111
Bitmap,
101112
WindowIcon
102113
}
114+
115+
// Called when Avalonia init is done
116+
public override void OnFrameworkInitializationCompleted()
117+
{
118+
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
119+
{
120+
desktop.Startup += OnStartup;
121+
desktop.Exit += OnExit;
122+
}
123+
}
124+
125+
private void OnStartup(object? s, ControlledApplicationLifetimeStartupEventArgs e)
126+
{
127+
var loc = Locator.Current.GetRequiredService<LocalizationManager>();
128+
var msgr = Locator.Current.GetRequiredService<LauncherMessaging>();
129+
var contentManager = Locator.Current.GetRequiredService<ContentManager>();
130+
var overrideAssets = Locator.Current.GetRequiredService<OverrideAssetsManager>();
131+
var launcherInfo = Locator.Current.GetRequiredService<LauncherInfoManager>();
132+
133+
loc.Initialize();
134+
launcherInfo.Initialize();
135+
contentManager.Initialize();
136+
overrideAssets.Initialize();
137+
138+
var viewModel = new MainWindowViewModel();
139+
var window = new MainWindow
140+
{
141+
DataContext = viewModel
142+
};
143+
viewModel.OnWindowInitialized();
144+
145+
loc.LanguageSwitched += () =>
146+
{
147+
window.ReloadContent();
148+
149+
// Reloading content isn't a smooth process anyway, so let's do some housekeeping while we're at it.
150+
GC.Collect();
151+
};
152+
153+
var lc = new LauncherCommands(viewModel);
154+
lc.RunCommandTask();
155+
Locator.CurrentMutable.RegisterConstant(lc);
156+
msgr.StartServerTask(lc);
157+
158+
window.Show();
159+
}
160+
161+
private void OnExit(object? sender, ControlledApplicationLifetimeExitEventArgs e)
162+
{
163+
var msgr = Locator.Current.GetRequiredService<LauncherMessaging>();
164+
msgr.StopAndWait();
165+
}
103166
}

SS14.Launcher/Assets/Locale/de/text.ftl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,10 @@ login-forgot-button-submit = Absenden
182182
# Strings for the "forgot password" view on login
183183
login-forgot-success-message = Ein Wiederherstellungslink wurde zu deiner E-Mail-Adresse gesendet.
184184
# Strings for the "connecting" menu that appears when connecting to a server.
185-
connecting-status-update-error = Ein Fehler ist aufgetreten beim runterladen der Spieldateien. Bitte frage nach Hilfe auf dem Discord wenn das Problem weiterhin besteht.
185+
connecting-status-update-error =
186+
Ein Fehler ist aufgetreten beim runterladen der Spieldateien. Bitte frage nach Hilfe auf dem Discord wenn das Problem weiterhin besteht.
187+
188+
Error: { $err }
186189
# Strings for the general main window layout of the launcher
187190
main-window-busy-checking-update = Suche nach Updates…
188191
# Long region names for server tag filters (shown in tooltip)

SS14.Launcher/Assets/Locale/el/text.ftl

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ tab-home-favorite-servers = Αγαπημένοι διακομιστές:
5050
# 'Example' name shown as a watermark in the name input box
5151
add-favorite-window-example-name = Διαστημικός Σταθμός Χονκ
5252
# Strings for the "connecting" menu that appears when connecting to a server.
53-
connecting-status-update-error = Υπήρχε σφάλμα στη λήψη αρχείων από τον εξυπηρετητή. Εάν το πρόβλημα επιμένει ζητείστε βοήθεια στο Discord.
53+
connecting-status-update-error =
54+
Υπήρξε σφάλμα κατά τη λήψη του περιεχομένου του διακομιστή. Εάν αυτό παραμένει, δοκιμάστε κάποια από τις παρακάτω λύσεις:
55+
- Δοκιμάστε να συνδεθείτε σε έναν άλλο διακομιστή για να δείτε αν το πρόβλημα παραμένει.
56+
- Δοκιμάστε να απενεργοποιήσετε ή να ενεργοποιήσετε προγράμματα σαν VPN, εάν έχετε.
57+
58+
Αν συνεχίζετε να έχετε προβλήματα, προσπαθήστε πρώτα να επικοινωνήσετε με τον διακομιστή στον οποίο προσπαθείτε να συνδεθείτε, πριν ζητήσετε υποστήριξη στο επίσημο Discord ή στο φόρουμ του Space Station 14.
59+
60+
Τεχνικό σφάλμα: { $err }
5461
# Localization for the "add favorite server" dialog window
5562
add-favorite-window-label-address = Διεύθυνση IP:
5663
# Strings for the "connecting" menu that appears when connecting to a server.
@@ -402,15 +409,15 @@ server-entry-description-none = Καμία περιγραφής διακομισ
402409
# Strings for entries in the server list (including home page)
403410
server-fetched-from-hub = 'Εγινε ανάκτηση από { $hub }
404411
# Strings for the "servers" tab
405-
tab-servers-list-status-partial-error = Απέτυχε η aνάκτηση κάποιων ή όλων των λίστων διακομιστών. Επιβεβαιώστε ότι οι ρυθμίσεις Hub είναι σωστές.
412+
tab-servers-list-status-partial-error = Απέτυχε η ανάκτηση κάποιων από τις λίστες διακομιστών. Επιβεβαιώστε ότι οι ρυθμίσεις Hub είναι σωστές και δοκιμάστε ανανέωση.
406413
# Strings for the "forgot password" view on login
407414
login-forgot-success-message = 'Ενας σύνδεσμος επαναφοράς έχει σταλεί στο email σας.
408415
# Short region names for server tag filters (shown in filter check box)
409416
region-short-north-america-east = Ανατολική Βόρεια Αμερική
410417
# Server roleplay levels for the filters menu
411418
filters-rp-none = Καθόλου
412419
# Strings for the "servers" tab
413-
tab-servers-list-status-error = Παρουσιάστηκε σφάλμα κατά την aνάκτηση της κύριας λίστας διακομιστών.
420+
tab-servers-list-status-error = Παρουσιάστηκε σφάλμα κατά την aνάκτηση της κύριας λίστας διακομιστών. Ίσως να δοκιμάσετε ανανέωση;
414421
# Short region names for server tag filters (shown in filter check box)
415422
region-short-europe-east = Ανατολική Ευρώπη
416423
# Strings for the "servers" tab
@@ -442,7 +449,7 @@ tab-home-title = Σπίτι
442449
# Strings for the "home" tab
443450
tab-home-add-favorite = Πρόσθεσε αγαπημένο…
444451
# Strings for the "home" tab
445-
tab-home-refresh = Refresh
452+
tab-home-refresh = Ανανέωση
446453
# Strings for the "home" tab
447454
tab-home-direct-connect = Άμεση σύνδεση σε διακομιστή…
448455
# Strings for the "home" tab
@@ -532,3 +539,11 @@ connecting-privacy-policy-view = Προβολή πολιτικής απορρή
532539
connecting-privacy-policy-text = Αυτός ο διακομιστής απαιτεί να αποδεχτείτε την πολιτική απορρήτου του πριν συνδεθείτε.
533540
connecting-privacy-policy-text-version-changed = Αυτός ο διακομιστής έχει ενημερώσει την πολιτική απορρήτου του από την τελευταία φορά που παίξατε. Πρέπει να αποδεχτείτε τη νέα έκδοση πριν συνδεθείτε.
534541
connecting-privacy-policy-decline = Δεν αποδέχομαι (αποσύνδεση)
542+
tab-servers-table-round-time = Χρόνος
543+
server-entry-status-lobby = Λόμπι
544+
connecting-status-update-error-unknown = Άγνωστο
545+
server-entry-round-time =
546+
{ $hours ->
547+
[0] { $mins }M
548+
*[1] { $hours }H { $mins }M
549+
}

0 commit comments

Comments
 (0)