From 2787d3f3ea3b210dc7e415c1c11c927e04d367a1 Mon Sep 17 00:00:00 2001 From: Pd233 Date: Tue, 26 Dec 2023 14:27:22 +0800 Subject: [PATCH] fix build --- src/LipUI.sln | 5 +--- src/LipUI/LipUI.csproj | 13 ++++++++++ src/LipUI/LipUI_TemporaryKey.pfx | Bin 0 -> 2520 bytes src/LipUI/MainWindow.xaml.cs | 4 +-- src/LipUI/Package.appxmanifest | 2 +- src/LipUI/Pages/HomePage.xaml | 3 ++- src/LipUI/Pages/HomePage.xaml.cs | 24 +++++++++++++++++- src/LipUI/Pages/LocalPackagePage.xaml.cs | 5 +--- .../VIews/ServerInstanceEditView.xaml.cs | 17 +++++++++++++ 9 files changed, 60 insertions(+), 13 deletions(-) create mode 100644 src/LipUI/LipUI_TemporaryKey.pfx diff --git a/src/LipUI.sln b/src/LipUI.sln index dbb8e29..67c36f3 100644 --- a/src/LipUI.sln +++ b/src/LipUI.sln @@ -9,7 +9,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LipNETWrapperTest", "LipNET EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LipWebApi", "LipWebApi\LipWebApi.csproj", "{17569CD2-D4D2-4E10-927C-BECEAECF7786}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LipUI", "LipUI\LipUI.csproj", "{ADF26F0A-8BCE-4F01-ACA8-042B9EC35064}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LipUI", "LipUI\LipUI.csproj", "{ADF26F0A-8BCE-4F01-ACA8-042B9EC35064}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -36,7 +36,6 @@ Global {A274FAC9-3169-4EAB-A659-4090F8D6E568}.Release|ARM64.ActiveCfg = Release|Any CPU {A274FAC9-3169-4EAB-A659-4090F8D6E568}.Release|ARM64.Build.0 = Release|Any CPU {A274FAC9-3169-4EAB-A659-4090F8D6E568}.Release|x64.ActiveCfg = Release|Any CPU - {A274FAC9-3169-4EAB-A659-4090F8D6E568}.Release|x64.Build.0 = Release|Any CPU {A274FAC9-3169-4EAB-A659-4090F8D6E568}.Release|x86.ActiveCfg = Release|Any CPU {A274FAC9-3169-4EAB-A659-4090F8D6E568}.Release|x86.Build.0 = Release|Any CPU {2245E398-21FD-4F05-87A8-C6E8E29A4685}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -52,7 +51,6 @@ Global {2245E398-21FD-4F05-87A8-C6E8E29A4685}.Release|ARM64.ActiveCfg = Release|Any CPU {2245E398-21FD-4F05-87A8-C6E8E29A4685}.Release|ARM64.Build.0 = Release|Any CPU {2245E398-21FD-4F05-87A8-C6E8E29A4685}.Release|x64.ActiveCfg = Release|Any CPU - {2245E398-21FD-4F05-87A8-C6E8E29A4685}.Release|x64.Build.0 = Release|Any CPU {2245E398-21FD-4F05-87A8-C6E8E29A4685}.Release|x86.ActiveCfg = Release|Any CPU {2245E398-21FD-4F05-87A8-C6E8E29A4685}.Release|x86.Build.0 = Release|Any CPU {17569CD2-D4D2-4E10-927C-BECEAECF7786}.Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -68,7 +66,6 @@ Global {17569CD2-D4D2-4E10-927C-BECEAECF7786}.Release|ARM64.ActiveCfg = Release|Any CPU {17569CD2-D4D2-4E10-927C-BECEAECF7786}.Release|ARM64.Build.0 = Release|Any CPU {17569CD2-D4D2-4E10-927C-BECEAECF7786}.Release|x64.ActiveCfg = Release|Any CPU - {17569CD2-D4D2-4E10-927C-BECEAECF7786}.Release|x64.Build.0 = Release|Any CPU {17569CD2-D4D2-4E10-927C-BECEAECF7786}.Release|x86.ActiveCfg = Release|Any CPU {17569CD2-D4D2-4E10-927C-BECEAECF7786}.Release|x86.Build.0 = Release|Any CPU {ADF26F0A-8BCE-4F01-ACA8-042B9EC35064}.Debug|Any CPU.ActiveCfg = Debug|x64 diff --git a/src/LipUI/LipUI.csproj b/src/LipUI/LipUI.csproj index 5eb38f1..11f34b2 100644 --- a/src/LipUI/LipUI.csproj +++ b/src/LipUI/LipUI.csproj @@ -1,5 +1,9 @@ + + None + true + WinExe net7.0-windows10.0.19041.0 10.0.17763.0 @@ -12,6 +16,15 @@ true true enable + False + True + 41F2155140B5369541BFDEEAC7B71FFB18F9E6DF + SHA256 + True + True + True + Never + 0 diff --git a/src/LipUI/LipUI_TemporaryKey.pfx b/src/LipUI/LipUI_TemporaryKey.pfx new file mode 100644 index 0000000000000000000000000000000000000000..04c4dee8a091940a2b4daff5f1dac9bfc210c4c0 GIT binary patch literal 2520 zcmZWqc|6ox8~=?NBRe&WyX>M5AzqLMWU;EZQGUVc+$g`L5o$5}QC<^FdS4;P4yMuBXjDUc1c1eEJP zG^;ruRB1~Upo!TeROsmMO_h$)L3Lrvn$=Y#RU$VbyX_kS^x5) z>FN1Qd>?xXy;AWDcKe%NVh#3Yx|Si18ELD_b{Gd=fBd7c<6BLa!$2QLfY-R?ORtDuaxA+Q*niJVVcu`NSUfQH&I=NPeEv{w zZAbAoA8anVlCx^5rgffga>~8Fx5Q~(bq8|il+|4CQB2y!M2B+MVbN#vA;cH?J_VUy z6DpjuU+XHV4L|NM*}i*MMAA zD#8aB;Q#H$M7jH_Uj8D+xE`)h80$6T=sx;HmG=IE;&aJ~z>F)c=>?Y)+OS}57>w}{Qba%&i$F*A*r92`H{$n#T zw^bpr;lG+KOl{PM5_8RUcK~taAvtbcKCq1;WvSlG>|uw~=ni!A?Qm zI$@lx-mB{BKV457`|w>3-c{`3Q}`f~Wi%cmb-5{kG-H=>5GA`4O?LfkdR|4_zLUat z#2nD35yzHho)+l8At>+dGy700DJ|EfV)iPwrEjcKBZ*0;7As+-w0(S1s}Oa*fdAQ{ zVg5ua24$x07>goSXGNnN*JYJksv41sYiCAcPX8jJqvh)~?QpmmS4yc6USN;&Qb-m zsxj(;3zWx0JF5rn{uf7sCDzYyoXxRQg|3#91Me6iN@(W&pQJafExuR4MPQugE^DM& z{e~o!i|L$oC^e*2@AZUJQ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SUO^)*kuVBpo9jY~T*o=)H&?b69MKl$fwFeXY%K0-_*K@viWvtA54 zCycbCj)O(|8>Tbx+O+h3`Y(FpST?H_TZy5mR|}2;B;g9GN9Ljh}*w51#> zJgTa diff --git a/src/LipUI/Pages/HomePage.xaml b/src/LipUI/Pages/HomePage.xaml index da5cddf..0e499f5 100644 --- a/src/LipUI/Pages/HomePage.xaml +++ b/src/LipUI/Pages/HomePage.xaml @@ -57,7 +57,8 @@ diff --git a/src/LipUI/Pages/HomePage.xaml.cs b/src/LipUI/Pages/HomePage.xaml.cs index 2970853..e0c2010 100644 --- a/src/LipUI/Pages/HomePage.xaml.cs +++ b/src/LipUI/Pages/HomePage.xaml.cs @@ -3,6 +3,7 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using System; +using System.Diagnostics; using System.IO; // To learn more about WinUI, the WinUI project structure, @@ -37,7 +38,7 @@ private void Page_Loaded(object sender, RoutedEventArgs e) private void ShowLipInstallerPageIfNotExist() { - if (File.Exists(Main.Config.Settings.LipPath)) + if (File.Exists(Main.Config.Settings.LipPath)) { return; } @@ -53,4 +54,25 @@ private void ShowLipInstallerPageIfNotExist() await dialog.ShowAsync(); }); } + + private void StartServerButton_Click(object sender, RoutedEventArgs e) + { + if (Main.Config.SelectedServer is null) + return; + + var dir = Main.Config.SelectedServer.WorkingDirectory; + var path = Path.Combine(dir, "bedrock_server_mod.exe"); + + if (File.Exists(path)) + { + Process.Start(path); + return; + } + + path = Path.Combine(dir, "bedrock_server.exe"); + if(File.Exists(path)) + { + Process.Start(path); + } + } } diff --git a/src/LipUI/Pages/LocalPackagePage.xaml.cs b/src/LipUI/Pages/LocalPackagePage.xaml.cs index f1324bc..2265c13 100644 --- a/src/LipUI/Pages/LocalPackagePage.xaml.cs +++ b/src/LipUI/Pages/LocalPackagePage.xaml.cs @@ -1,4 +1,3 @@ -using LipUI.Language; using LipUI.Models; using LipUI.Models.Lip; using LipUI.Protocol; @@ -7,9 +6,7 @@ using Microsoft.UI.Xaml.Controls; using System; using System.Collections.Generic; -using System.Linq; using System.Text.Json; -using System.Threading.Tasks; // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. @@ -23,7 +20,7 @@ public sealed partial class LocalPackagePage : Page { public LocalPackagePage() { - this.InitializeComponent(); + InitializeComponent(); } private void ReloadPackage() diff --git a/src/LipUI/VIews/ServerInstanceEditView.xaml.cs b/src/LipUI/VIews/ServerInstanceEditView.xaml.cs index 24c7325..e9e0075 100644 --- a/src/LipUI/VIews/ServerInstanceEditView.xaml.cs +++ b/src/LipUI/VIews/ServerInstanceEditView.xaml.cs @@ -3,6 +3,7 @@ using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Media.Imaging; using System; +using System.IO; using System.Threading.Tasks; using Windows.Storage.Pickers; using WinRT.Interop; @@ -70,6 +71,22 @@ public void CommitServerProperies() Server.Description = DescriptionInput.Text; Server.Version = VersionInput.Text; Server.WorkingDirectory = WorkingDirectoryInput.Text; + + if (iconPath is not null) + { + var dir = Path.Combine(Server.WorkingDirectory, DefaultSettings.DataDirectory); + + if (Directory.Exists(dir) is false) + Directory.CreateDirectory(dir); + + var dest = Path.Combine(dir, $"icon{new FileInfo(iconPath).Extension}"); + + File.Copy(iconPath, dest); + + Server.Icon = dest; + return; + } + Server.Icon = iconPath; } }