From 46fe58f7433c833ab05d7a8084af8f944f82306d Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 31 Dec 2024 10:35:11 +1000 Subject: [PATCH] Client updates for net9 --- OTAPI.Client.Launcher/Actions/OTAPI.cs | 11 +- OTAPI.Client.Launcher/MainWindow.axaml | 2 +- OTAPI.Client.Launcher/MainWindow.axaml.cs | 61 ++++++- .../OTAPI.Client.Launcher.csproj | 17 +- OTAPI.Client.Launcher/Program.cs | 10 +- .../Targets/IPlatformTarget.cs | 6 +- .../Targets/InstallTarget.Extensions.cs | 141 ++++++++------- .../Targets/LinuxPlatformTarget.cs | 8 +- .../Targets/MacOSPlatformTarget.cs | 8 +- .../Targets/WindowsPlatformTarget.cs | 8 +- .../otapi/otapi-runtime/ImGuiRenderer.cs | 170 +++++++++++------- OTAPI.Patcher/Common.cs | 12 +- OTAPI.Patcher/OTAPI.Patcher.csproj | 6 +- OTAPI.Patcher/Targets/PCClientTarget.cs | 20 +-- .../Mods/CorrectLegacyAudioPaths.Client.cs | 40 +++++ OTAPI.Scripts/OTAPI.Scripts.csproj | 2 +- .../OTAPI.Server.Launcher.csproj | 10 +- .../RuntimeExample.Server.csproj | 2 +- 18 files changed, 337 insertions(+), 197 deletions(-) create mode 100644 OTAPI.Scripts/Mods/CorrectLegacyAudioPaths.Client.cs diff --git a/OTAPI.Client.Launcher/Actions/OTAPI.cs b/OTAPI.Client.Launcher/Actions/OTAPI.cs index 82c7f7ec5..653270de6 100644 --- a/OTAPI.Client.Launcher/Actions/OTAPI.cs +++ b/OTAPI.Client.Launcher/Actions/OTAPI.cs @@ -114,7 +114,6 @@ public static void Launch(string[] args) GC.Collect(); - CSharpLoader.OnCompilationContext += CSharpLoader_OnCompilationContext; AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; @@ -232,7 +231,7 @@ static string ResolveFile(string path) using var stream = root.GetManifestResourceStream(text); if (stream is null) return null; byte[] array = new byte[stream.Length]; - stream.Read(array, 0, array.Length); + stream.ReadExactly(array); stream.Seek(0, SeekOrigin.Begin); // if (!File.Exists(resourceName)) @@ -267,10 +266,10 @@ static IntPtr ResolveNativeDep(string libraryName, Assembly assembly, DllImportS IEnumerable matches = Enumerable.Empty(); foreach (var basePath in new[] { - Environment.CurrentDirectory, - AppContext.BaseDirectory, - Path.Combine(Environment.CurrentDirectory, "client") - }) + Environment.CurrentDirectory, + AppContext.BaseDirectory, + Path.Combine(Environment.CurrentDirectory, "client") + }) { if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { diff --git a/OTAPI.Client.Launcher/MainWindow.axaml b/OTAPI.Client.Launcher/MainWindow.axaml index b47eaf06f..39a3a3505 100644 --- a/OTAPI.Client.Launcher/MainWindow.axaml +++ b/OTAPI.Client.Launcher/MainWindow.axaml @@ -23,7 +23,7 @@