Skip to content

Commit

Permalink
feat: add support for .net 9
Browse files Browse the repository at this point in the history
  • Loading branch information
Shiqan committed Nov 13, 2024
1 parent 2a22812 commit e5ab740
Show file tree
Hide file tree
Showing 15 changed files with 82 additions and 75 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build

on:
push:
branches: [ master ]
branches: [ '*' ]
pull_request:
branches: [ master ]

Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/BenchmarkReader/BenchmarkReader.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\FortniteReplayReader\FortniteReplayReader.csproj" />
Expand Down
8 changes: 4 additions & 4 deletions src/ConsoleReader/ConsoleReader.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
Expand Down Expand Up @@ -31,8 +31,8 @@
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
</ItemGroup>
</Project>
69 changes: 33 additions & 36 deletions src/ConsoleReader/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ILogger<Program>>();

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<ILogger<Program>>();
// 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 ----");
10 changes: 5 additions & 5 deletions src/FortniteReplayReader.Test/FortniteReplayReader.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
Expand All @@ -9,13 +9,13 @@
<None Remove="AthenaTeamStats\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="6.0.1">
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions src/FortniteReplayReader/FortniteReplayReader.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<Nullable>enable</Nullable>
<AssemblyName>FortniteReplayReader</AssemblyName>
<RootNamespace>FortniteReplayReader</RootNamespace>
Expand All @@ -25,6 +25,6 @@
<ProjectReference Include="..\Unreal.Encryption\Unreal.Encryption.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
</ItemGroup>
</Project>
10 changes: 5 additions & 5 deletions src/OozSharp.Test/OozSharp.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="6.0.1">
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion src/OozSharp/OozSharp.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Authors>SL-x-TnT, Shiqan</Authors>
<Company />
Expand Down
10 changes: 5 additions & 5 deletions src/Unreal.Core.Test/Unreal.Core.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="6.0.1">
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
4 changes: 2 additions & 2 deletions src/Unreal.Core/Unreal.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<Nullable>enable</Nullable>
<AssemblyName>Unreal.Core</AssemblyName>
<RootNamespace>Unreal.Core</RootNamespace>
Expand All @@ -21,6 +21,6 @@
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
</ItemGroup>
</Project>
10 changes: 5 additions & 5 deletions src/Unreal.Encryption.Test/Unreal.Encryption.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="coverlet.msbuild" Version="6.0.1">
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
2 changes: 1 addition & 1 deletion src/Unreal.Encryption/Unreal.Encryption.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<Authors>Shiqan</Authors>
<Company />
<Description>Unreal Engine replay encryption layer</Description>
Expand Down

0 comments on commit e5ab740

Please sign in to comment.