diff --git a/.github/workflows/qa.yml b/.github/workflows/qa.yml index 7f44d434..61b7a550 100644 --- a/.github/workflows/qa.yml +++ b/.github/workflows/qa.yml @@ -23,7 +23,7 @@ jobs: run: dotnet restore "./FModel/FModel.slnx" -r win-x64 - name: .NET Publish - run: dotnet publish "./FModel/FModel.csproj" -c Release --no-restore --no-self-contained -r win-x64 -f net8.0-windows -o "./FModel/bin/Publish/" -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:DebugType=None -p:GenerateDocumentationFile=false -p:DebugSymbols=false + run: dotnet publish "./FModel/FModel.csproj" -c Release --no-restore --no-self-contained -r win-x64 -f net10.0-windows -o "./FModel/bin/Publish/" -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:DebugType=None -p:GenerateDocumentationFile=false -p:DebugSymbols=false - name: ZIP File uses: thedoctor0/zip-release@0.7.6 diff --git a/CUE4Parse b/CUE4Parse index f44f491f..885dd3c4 160000 --- a/CUE4Parse +++ b/CUE4Parse @@ -1 +1 @@ -Subproject commit f44f491ff28d5dc79e998810aab9c5073ab8f33d +Subproject commit 885dd3c4012cf5d85a66e2b06db36c692c53d751 diff --git a/FModel/App.xaml.cs b/FModel/App.xaml.cs index b37f3b8b..0d01ea4d 100644 --- a/FModel/App.xaml.cs +++ b/FModel/App.xaml.cs @@ -112,27 +112,39 @@ public partial class App Directory.CreateDirectory(Path.Combine(UserSettings.Default.OutputDirectory, "Logs")); Directory.CreateDirectory(Path.Combine(UserSettings.Default.OutputDirectory, ".data")); - const string template = "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] {Enriched}: {Message:lj}{NewLine}{Exception}"; +#if DEBUG + var filePath = Path.Combine(UserSettings.Default.OutputDirectory, "Logs", $"FModel-Debug-Log-{DateTime.Now:yyyy-MM-dd}.log"); +#else + var filePath = Path.Combine(UserSettings.Default.OutputDirectory, "Logs", $"FModel-Log-{DateTime.Now:yyyy-MM-dd}.log"); +#endif + const string template1 = "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] {Enriched}: {Message:lj}{NewLine}{Exception}"; + const string template2 = "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level:u3}] [{ClassName}] {ObjectName}: {Message:lj}{NewLine}{Exception}"; Log.Logger = new LoggerConfiguration() #if DEBUG .Enrich.With() .MinimumLevel.Verbose() - .WriteTo.Console(outputTemplate: template, theme: AnsiConsoleTheme.Literate) - .WriteTo.File(outputTemplate: template, - path: Path.Combine(UserSettings.Default.OutputDirectory, "Logs", $"FModel-Debug-Log-{DateTime.Now:yyyy-MM-dd}.log")) - .MinimumLevel.Override("CUE4Parse_Conversion", LogEventLevel.Verbose).WriteTo.Sink(ImGuiSink.Instance) #else .Enrich.With() - .WriteTo.File(outputTemplate: template, - path: Path.Combine(UserSettings.Default.OutputDirectory, "Logs", $"FModel-Log-{DateTime.Now:yyyy-MM-dd}.log")) - .MinimumLevel.Override("CUE4Parse_Conversion", LogEventLevel.Verbose).WriteTo.Sink(ImGuiSink.Instance) #endif + .WriteTo.Logger(lc => lc + .Filter.ByExcluding(IsConversionLibrary) + .WriteTo.Console(outputTemplate: template1, theme: AnsiConsoleTheme.Literate) + .WriteTo.File(outputTemplate: template1, path: filePath)) + .WriteTo.Logger(lc => lc + .Filter.ByIncludingOnly(IsConversionLibrary) + .WriteTo.Console(outputTemplate: template2, theme: AnsiConsoleTheme.Literate) + .WriteTo.File(outputTemplate: template2, path: filePath)) + .MinimumLevel.Override("CUE4Parse_Conversion", LogEventLevel.Verbose).WriteTo.Sink(ImGuiSink.Instance) .CreateLogger(); Log.Information("Version {Version} ({CommitId})", Constants.APP_VERSION, Constants.APP_COMMIT_ID); Log.Information("{OS}", GetOperatingSystemProductName()); Log.Information("{RuntimeVer}", RuntimeInformation.FrameworkDescription); Log.Information("Culture {SysLang}", CultureInfo.CurrentCulture); + + static bool IsConversionLibrary(LogEvent e) => + e.Properties.TryGetValue("SourceContext", out var sc) && + sc.ToString().Contains("CUE4Parse_Conversion"); } private void AppExit(object sender, ExitEventArgs e) diff --git a/FModel/Creator/CreatorPackage.cs b/FModel/Creator/CreatorPackage.cs index b2b12284..4369fdd4 100644 --- a/FModel/Creator/CreatorPackage.cs +++ b/FModel/Creator/CreatorPackage.cs @@ -45,6 +45,7 @@ public class CreatorPackage : IDisposable case "AthenaMusicPackItemDefinition": case "AthenaBattleBusItemDefinition": case "AthenaCharacterItemDefinition": + case "ExtractableItemDefinition": case "AthenaMapMarkerItemDefinition": case "AthenaBackpackItemDefinition": case "CosmeticShoesItemDefinition": diff --git a/FModel/FModel.csproj b/FModel/FModel.csproj index 784f33ee..1bfc1c33 100644 --- a/FModel/FModel.csproj +++ b/FModel/FModel.csproj @@ -162,8 +162,7 @@ - - + diff --git a/FModel/ViewModels/CUE4ParseViewModel.cs b/FModel/ViewModels/CUE4ParseViewModel.cs index 0b14700f..157922dc 100644 --- a/FModel/ViewModels/CUE4ParseViewModel.cs +++ b/FModel/ViewModels/CUE4ParseViewModel.cs @@ -67,7 +67,6 @@ using CUE4Parse_Conversion.Exporters; using CUE4Parse_Conversion.Sounds; using EpicManifestParser; using EpicManifestParser.UE; -using EpicManifestParser.ZlibngDotNetDecompressor; using FModel.Creator; using FModel.Extensions; using FModel.Framework; @@ -96,6 +95,8 @@ public class CUE4ParseViewModel : ViewModel private readonly Regex _fnLiveRegex = new(@"^FortniteGame[/\\]Content[/\\]Paks[/\\]", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); + private static readonly HttpClient _chunkClient = ManifestParseOptions.CreateDefaultClient(); + private bool _modelIsOverwritingMaterial; public bool ModelIsOverwritingMaterial { @@ -226,9 +227,9 @@ public class CUE4ParseViewModel : ViewModel { Provider.OnDemandOptions = new IoStoreOnDemandOptions { - ChunkHostUri = new Uri("https://download.epicgames.com/", UriKind.Absolute), + ChunkHostUri = new Uri("https://egdownload.fastly-edge.com/", UriKind.Absolute), ChunkCacheDirectory = Directory.CreateDirectory(Path.Combine(UserSettings.Default.OutputDirectory, ".data")), - Timeout = TimeSpan.FromSeconds(30) + DownloaderClient = _chunkClient }; switch (Provider) @@ -249,9 +250,9 @@ public class CUE4ParseViewModel : ViewModel { ChunkCacheDirectory = cacheDir, ManifestCacheDirectory = cacheDir, - ChunkBaseUrl = "http://download.epicgames.com/Builds/Fortnite/CloudDir/", - Decompressor = ManifestZlibngDotNetDecompressor.Decompress, - DecompressorState = ZlibHelper.Instance, + ChunkBaseUrl = "https://egdownload.fastly-edge.com/Builds/Fortnite/CloudDir/", + Decompressor = Compression.Decompressor, + Client = _chunkClient, CacheChunksAsIs = false }; @@ -262,7 +263,7 @@ public class CUE4ParseViewModel : ViewModel { (manifest, _) = manifestInfo.DownloadAndParseAsync(manifestOptions, cancellationToken: cancellationToken, - elementManifestPredicate: static x => x.Uri.Host == "download.epicgames.com" || x.Uri.Host == "epicgames-download1.akamaized.net" + elementDownloadPredicate: static x => x.Uri.Host is "egdownload.fastly-edge.com" or "epicgames-download1.akamaized.net" or "download.epicgames.com" ).GetAwaiter().GetResult(); } catch (HttpRequestException ex)