Commit 32667b7
committed
refactor(logging,desktop,ci): unify logger, complete Desktop WPF rewrite, fix CI, update .gitignore
Logger unification (Trion.Core → all projects):
- Remove Success level from LogLevel; add Debug; fix ShowInfo default to true
- Fix TrionLogger.MapLevel: Trace/Debug → LogLevel.Debug (was Info)
- Fix Enqueue filter to check ShowDebug; fix WriteConsole colors for updated enum
- Add ILoggerExtensions.LogException to bridge old call-site API to ILogger
- Delete dead LoggerExtensions.cs (IServiceCollection variant, never used)
- Delete Desktop ITrionLogger interface and its standalone TrionLogger impl
- Add ProjectReference from Trion.Desktop to Trion.Core; bump ME.* to 9.0.9
- Migrate App.xaml.cs to ConfigureLogging + AddTrionLogger + ILogger<App>
- Migrate MySqlSetupService to ILogger<MySqlSetupService>
- Migrate ServerControlViewModel to ILogger<ServerControlViewModel>
Desktop WPF application (Trion.Desktop) — full rewrite with MVVM + DI:
Views/Pages:
- MainWindow: custom chrome, navigation shell, tray integration, accent sync
- LoginWindow: username/password, remember-me, continue-offline, version footer
- DashboardView: live CPU/RAM/disk metrics, server status cards, notification feed
- ServerControlView: start/stop Database/World/Logon servers with crash detection
and configurable auto-restart (up to 5 attempts per server)
- InstallerView: per-expansion emulator download and install progress tracking
- DatabaseEditorView: MySQL database query and management UI
- DdnsView: DDNS provider configuration and manual/auto update controls
- LogsView: live log viewer with level filtering
- SettingsView: theme, language, paths, MySQL, server, network settings
- SinglePlayerView: single-player/LAN server configuration
- SupportersView: supporter tier list fetched from API
- TrayMenuWindow: system-tray popup with quick server controls
Services:
- MySqlSetupService: portable MySQL 8 download (Trion API + CDN fallback),
hardware-tuned my.ini generation (40% RAM for InnoDB buffer pool),
data directory init, phoenix user setup, start/stop/repair/reinstall,
crash detection + auto-restart with configurable max restarts
- SystemMetricsService: hosted service polling CPU/RAM/disk every second
- ThemeService: dark/light theme switching with per-accent-color event
- LocalizationService: runtime language switching via Strings.*.json files
- NavigationService: MVVM page navigation with history
- NotificationService: in-app notification queue with timestamps
- ApiKeyService: guest/supporter API key lifecycle (register, cache, refresh)
- AccountService: login, session token storage, remember-me, guest mode
- NewsService + SupportersService: HTTP fetch with retry from Trion API
- EmulatorInstallerService: per-expansion download, extract, and version tracking
- DdnsUpdateService: background DDNS polling against multiple provider URLs
- DatabaseService: MySQL query execution with connection pooling
- TrayService: Windows system tray icon with dynamic accent color and context menu
ViewModels (CommunityToolkit.Mvvm, full MVVM):
- MainWindowViewModel: navigation state, page switching, tray sync
- DashboardViewModel: metrics binding, MySQL banner, event log, notification feed
- ServerControlViewModel: Database/World/Logon toggle commands, CanExecute guards,
per-server crash monitor loop, Start All / Stop All, 3-second poll timer
- InstallerViewModel: expansion card grid, download progress, install state machine
- LoginViewModel: async login command, IsBusy spinner, error message binding
- SettingsViewModel: two-way settings binding, save-on-navigate
- DdnsViewModel, DatabaseEditorViewModel, LogsViewModel, SupportersViewModel,
SinglePlayerViewModel, EmulatorCardViewModel
Controls:
- MetricBar: custom bar control with animated fill and label
- ServerStatusCard: status indicator card bound to running/stopped state
- SparklineChart: lightweight Canvas-based sparkline for metric history
Infrastructure:
- Converters: BoolToVisibility, InverseBool, NullToVisibility, EnumToVisibility,
InverseBoolToVisibility, BoolToString, ResourceKey, StatusToColor
- ServiceCollectionExtensions: RegisterViewModels, RegisterViews, RegisterTrayService
- PasswordBoxHelper: attached property for MVVM-safe password binding
- Constants: ApiEndpoints, AppLinks, DbQueries, DdnsProviderUrls,
ExternalLinks (MySQL CDN/version), MySqlInitSql (first-run SQL script)
Updater (Trion.Updater):
- Minimal WPF window: progress bar with glow, phase label, status text, version footer
- Logo tinted with #00D4FF accent via OpacityMask (matches main app style)
- WindowStyle=None with drop-shadow border, no resize, center-screen
Assets — Trion logo embedded in WPF projects:
- Add res/icons/trion-logo/TrionLogoNew.png + TrionLogoNew250.png to repo
- Link PNGs as <Resource> items in Trion.Desktop.csproj and Trion.Updater.csproj
- Use OpacityMask Rectangle in MainWindow, LoginWindow, UpdaterWindow
- Fixes XamlParseException thrown at startup by missing pack:// URI resource
CI — split Windows / Linux jobs:
- build-windows: full solution restore + build + test; publishes Trion.Desktop
(WPF / net9.0-windows only) and Trion.Web; uploads Desktop + Web artifacts
- build-linux: explicit per-csproj restore + build for cross-platform projects
only (Core/API/Agent/Platform/UI/Web + test projects); excludes Trion.Desktop
and Trion.Updater (WPF / net9.0-windows TFM); uploads Web artifact
- Both jobs install aspire + wasm-tools workloads and upload coverage to Codecov
.gitignore improvements:
- Remove duplicates (*.pdb, *.DotSettings each listed twice)
- Add *.trx, coverage*.xml, *.cobertura.xml (test/coverage output)
- Add Logs/, database/, my.ini (runtime artifacts created by the app)
- Add .env, secrets.json, appsettings.Local.json (secrets/local config)
- Add *.pubxml.user, wwwroot/dist/, .claude/, desktop.ini
- Remove irrelevant patterns for a .NET project (*.class, *.seed, *.pid)1 parent 66098c6 commit 32667b7
170 files changed
Lines changed: 19046 additions & 98 deletions
File tree
- .github/workflows
- installer
- res/icons/trion-logo
- src
- Trion.API
- Data
- Endpoints
- Models
- Services
- Utilities
- Trion.Core/Logging
- Trion.Desktop
- Controls
- Infrastructure
- Constants
- Converters
- Extensions
- Helpers
- Models
- Properties/PublishProfiles
- Resources
- Icons
- Localization
- Styles
- Themes
- Services
- Interfaces
- ViewModels
- Views
- Trion.Updater
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
| 19 | + | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| |||
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
| 28 | + | |
30 | 29 | | |
31 | 30 | | |
32 | | - | |
| 31 | + | |
33 | 32 | | |
34 | 33 | | |
35 | | - | |
| 34 | + | |
36 | 35 | | |
37 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
38 | 115 | | |
39 | 116 | | |
40 | 117 | | |
41 | 118 | | |
42 | 119 | | |
43 | 120 | | |
44 | | - | |
| 121 | + | |
45 | 122 | | |
46 | 123 | | |
47 | 124 | | |
48 | | - | |
49 | 125 | | |
50 | 126 | | |
51 | 127 | | |
52 | 128 | | |
53 | 129 | | |
54 | | - | |
| 130 | + | |
55 | 131 | | |
56 | 132 | | |
57 | | - | |
58 | | - | |
| 133 | + | |
| 134 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | 11 | | |
24 | 12 | | |
25 | 13 | | |
26 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
27 | 20 | | |
28 | | - | |
| 21 | + | |
29 | 22 | | |
30 | 23 | | |
31 | 24 | | |
| |||
42 | 35 | | |
43 | 36 | | |
44 | 37 | | |
| 38 | + | |
| 39 | + | |
45 | 40 | | |
46 | 41 | | |
47 | 42 | | |
48 | 43 | | |
49 | 44 | | |
50 | 45 | | |
51 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | | - | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
67 | 64 | | |
68 | 65 | | |
69 | | - | |
| 66 | + | |
70 | 67 | | |
71 | 68 | | |
72 | 69 | | |
| |||
78 | 75 | | |
79 | 76 | | |
80 | 77 | | |
81 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
82 | 102 | | |
83 | 103 | | |
84 | 104 | | |
| |||
87 | 107 | | |
88 | 108 | | |
89 | 109 | | |
90 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
91 | 128 | | |
92 | 129 | | |
93 | | - | |
94 | | - | |
95 | 130 | | |
96 | 131 | | |
97 | 132 | | |
98 | 133 | | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
99 | 145 | | |
100 | 146 | | |
101 | 147 | | |
102 | 148 | | |
103 | 149 | | |
104 | | - | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| |||
119 | 121 | | |
120 | 122 | | |
121 | 123 | | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
122 | 136 | | |
123 | 137 | | |
124 | 138 | | |
| |||
155 | 169 | | |
156 | 170 | | |
157 | 171 | | |
| 172 | + | |
158 | 173 | | |
159 | 174 | | |
160 | 175 | | |
| |||
0 commit comments