From e5ab740e9daadd73b216834a37eb45229f36de94 Mon Sep 17 00:00:00 2001 From: Shiqan Date: Wed, 13 Nov 2024 20:21:12 +0100 Subject: [PATCH] feat: add support for .net 9 --- .github/workflows/build.yml | 6 +- .github/workflows/publish.yml | 6 +- CHANGELOG.md | 10 +++ README.md | 2 +- src/BenchmarkReader/BenchmarkReader.csproj | 4 +- src/ConsoleReader/ConsoleReader.csproj | 8 +-- src/ConsoleReader/Program.cs | 69 +++++++++---------- .../FortniteReplayReader.Test.csproj | 10 +-- .../FortniteReplayReader.csproj | 4 +- src/OozSharp.Test/OozSharp.Test.csproj | 10 +-- src/OozSharp/OozSharp.csproj | 2 +- src/Unreal.Core.Test/Unreal.Core.Test.csproj | 10 +-- src/Unreal.Core/Unreal.Core.csproj | 4 +- .../Unreal.Encryption.Test.csproj | 10 +-- .../Unreal.Encryption.csproj | 2 +- 15 files changed, 82 insertions(+), 75 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14d9ad1..7d08e82 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,7 @@ name: Build on: push: - branches: [ master ] + branches: [ '*' ] pull_request: branches: [ master ] @@ -18,11 +18,11 @@ jobs: uses: actions/checkout@v4 - name: Setup .NET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: | - 6.x 8.x + 9.x - name: Build run: dotnet build ./src/FortniteReplayDecompressor.sln --configuration Release diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1950fc7..07d1c1d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,14 +20,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup .NET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: dotnet-version: | - 6.x 8.x + 9.x - name: Build run: dotnet build ./src/FortniteReplayDecompressor.sln --configuration Release diff --git a/CHANGELOG.md b/CHANGELOG.md index 69bb5ad..37e145b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Interfaces to support proper DI - Register types to be parsed with DI +## [2.4.0] - 2024-11-13 +### Changed +- support .net9 + +### Removed +- support .net6 + ## [2.3.1] - 2024-11-08 ### Changed - fix parsing of `FGameplayTag` with new `bUseDynamicReplication` @@ -139,3 +146,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [2.2.0]: https://github.com/Shiqan/FortniteReplayDecompressor/releases/tag/2.2.0 [2.2.1]: https://github.com/Shiqan/FortniteReplayDecompressor/releases/tag/2.2.1 [2.2.2]: https://github.com/Shiqan/FortniteReplayDecompressor/releases/tag/2.2.2 +[2.3.1]: https://github.com/Shiqan/FortniteReplayDecompressor/releases/tag/2.3.0 +[2.3.1]: https://github.com/Shiqan/FortniteReplayDecompressor/releases/tag/2.3.1 +[2.4.0]: https://github.com/Shiqan/FortniteReplayDecompressor/releases/tag/2.4.0 diff --git a/README.md b/README.md index 54ee5dd..a655e5d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ C# parser for your Fortnite replays. ## Getting Started -.NET 6.0 or .NET 8.0 is required. +.NET 8.0 or .NET 9.0 is required. ```powershell dotnet add package FortniteReplayReader diff --git a/src/BenchmarkReader/BenchmarkReader.csproj b/src/BenchmarkReader/BenchmarkReader.csproj index db7683f..3a06bb0 100644 --- a/src/BenchmarkReader/BenchmarkReader.csproj +++ b/src/BenchmarkReader/BenchmarkReader.csproj @@ -1,11 +1,11 @@  Exe - net6.0;net8.0 + net8.0;net9.0 false - + diff --git a/src/ConsoleReader/ConsoleReader.csproj b/src/ConsoleReader/ConsoleReader.csproj index 3c61049..682dbb3 100644 --- a/src/ConsoleReader/ConsoleReader.csproj +++ b/src/ConsoleReader/ConsoleReader.csproj @@ -1,7 +1,7 @@  Exe - net6.0;net8.0 + net8.0;net9.0 false @@ -31,8 +31,8 @@ - - - + + + \ No newline at end of file diff --git a/src/ConsoleReader/Program.cs b/src/ConsoleReader/Program.cs index 2adb38f..2e19161 100644 --- a/src/ConsoleReader/Program.cs +++ b/src/ConsoleReader/Program.cs @@ -7,47 +7,44 @@ using Unreal.Core.Models.Enums; using static System.Environment; -namespace ConsoleReader; +// Set up dependency injection and logging services +var serviceCollection = new ServiceCollection() + .AddLogging(loggingBuilder => loggingBuilder + .AddConsole() + .SetMinimumLevel(LogLevel.Warning)); +var provider = serviceCollection.BuildServiceProvider(); +var logger = provider.GetService>(); -internal class Program -{ - private static void Main(string[] args) - { - var serviceCollection = new ServiceCollection() - .AddLogging(loggingBuilder => loggingBuilder - .AddConsole() - .SetMinimumLevel(LogLevel.Warning)); - var provider = serviceCollection.BuildServiceProvider(); - var logger = provider.GetService>(); +// Define the folder containing replay files +var localAppDataFolder = GetFolderPath(SpecialFolder.LocalApplicationData); +// var replayFilesFolder = Path.Combine(localAppDataFolder, @"FortniteGame\Saved\Demos"); +var replayFilesFolder = @"C:\Users\ferro\Downloads\"; +var replayFiles = Directory.EnumerateFiles(replayFilesFolder, "*.replay"); - var localAppDataFolder = GetFolderPath(SpecialFolder.LocalApplicationData); - //var replayFilesFolder = Path.Combine(localAppDataFolder, @"FortniteGame\Saved\Demos"); - //var replayFilesFolder = @"F:\Projects\FortniteReplayCollection\_upload\"; - var replayFilesFolder = @"C:\Users\ferro\Downloads\"; - var replayFiles = Directory.EnumerateFiles(replayFilesFolder, "*919.replay"); +var sw = new Stopwatch(); +long total = 0; - var sw = new Stopwatch(); #if DEBUG - var reader = new ReplayReader(logger, ParseMode.Minimal); +var reader = new ReplayReader(logger, ParseMode.Minimal); #else - var reader = new ReplayReader(null, ParseMode.Minimal); +var reader = new ReplayReader(null, ParseMode.Minimal); #endif - long total = 0; - foreach (var replayFile in replayFiles) - { - sw.Restart(); - try - { - var replay = reader.ReadReplay(replayFile); - } - catch (Exception ex) - { - Console.WriteLine(ex); - } - sw.Stop(); - Console.WriteLine($"---- {replayFile} : done in {sw.ElapsedMilliseconds} milliseconds ----"); - total += sw.ElapsedMilliseconds; - } - Console.WriteLine($"total: {total / 1000} seconds ----"); + +// Process each replay file +foreach (var replayFile in replayFiles) +{ + sw.Restart(); + try + { + var replay = reader.ReadReplay(replayFile); + } + catch (Exception ex) + { + Console.WriteLine(ex); } + sw.Stop(); + Console.WriteLine($"---- {replayFile} : done in {sw.ElapsedMilliseconds} milliseconds ----"); + total += sw.ElapsedMilliseconds; } + +Console.WriteLine($"total: {total / 1000} seconds ----"); diff --git a/src/FortniteReplayReader.Test/FortniteReplayReader.Test.csproj b/src/FortniteReplayReader.Test/FortniteReplayReader.Test.csproj index 4106591..0562120 100644 --- a/src/FortniteReplayReader.Test/FortniteReplayReader.Test.csproj +++ b/src/FortniteReplayReader.Test/FortniteReplayReader.Test.csproj @@ -1,6 +1,6 @@  - net6.0;net8.0 + net8.0;net9.0 false @@ -9,13 +9,13 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/FortniteReplayReader/FortniteReplayReader.csproj b/src/FortniteReplayReader/FortniteReplayReader.csproj index 2788658..f2427ba 100644 --- a/src/FortniteReplayReader/FortniteReplayReader.csproj +++ b/src/FortniteReplayReader/FortniteReplayReader.csproj @@ -1,6 +1,6 @@  - net6.0;net8.0 + net8.0;net9.0 enable FortniteReplayReader FortniteReplayReader @@ -25,6 +25,6 @@ - + \ No newline at end of file diff --git a/src/OozSharp.Test/OozSharp.Test.csproj b/src/OozSharp.Test/OozSharp.Test.csproj index 6332985..985787b 100644 --- a/src/OozSharp.Test/OozSharp.Test.csproj +++ b/src/OozSharp.Test/OozSharp.Test.csproj @@ -1,17 +1,17 @@  - net6.0;net8.0 + net8.0;net9.0 false true - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/OozSharp/OozSharp.csproj b/src/OozSharp/OozSharp.csproj index f7d42fa..82df9bd 100644 --- a/src/OozSharp/OozSharp.csproj +++ b/src/OozSharp/OozSharp.csproj @@ -1,6 +1,6 @@ - net6.0;net8.0 + net8.0;net9.0 true SL-x-TnT, Shiqan diff --git a/src/Unreal.Core.Test/Unreal.Core.Test.csproj b/src/Unreal.Core.Test/Unreal.Core.Test.csproj index 0bb6860..bec7ec8 100644 --- a/src/Unreal.Core.Test/Unreal.Core.Test.csproj +++ b/src/Unreal.Core.Test/Unreal.Core.Test.csproj @@ -1,16 +1,16 @@  - net6.0;net8.0 + net8.0;net9.0 false - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Unreal.Core/Unreal.Core.csproj b/src/Unreal.Core/Unreal.Core.csproj index 7be1b8f..7e5994c 100644 --- a/src/Unreal.Core/Unreal.Core.csproj +++ b/src/Unreal.Core/Unreal.Core.csproj @@ -1,6 +1,6 @@  - net6.0;net8.0 + net8.0;net9.0 enable Unreal.Core Unreal.Core @@ -21,6 +21,6 @@ - + \ No newline at end of file diff --git a/src/Unreal.Encryption.Test/Unreal.Encryption.Test.csproj b/src/Unreal.Encryption.Test/Unreal.Encryption.Test.csproj index 6dd4c7f..ec552a4 100644 --- a/src/Unreal.Encryption.Test/Unreal.Encryption.Test.csproj +++ b/src/Unreal.Encryption.Test/Unreal.Encryption.Test.csproj @@ -1,16 +1,16 @@  - net6.0;net8.0 + net8.0;net9.0 false - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Unreal.Encryption/Unreal.Encryption.csproj b/src/Unreal.Encryption/Unreal.Encryption.csproj index 72491f8..4b5937f 100644 --- a/src/Unreal.Encryption/Unreal.Encryption.csproj +++ b/src/Unreal.Encryption/Unreal.Encryption.csproj @@ -1,6 +1,6 @@  - net6.0;net8.0 + net8.0;net9.0 Shiqan Unreal Engine replay encryption layer